Selective reference range for adaptive video sample clipping
By employing selective reference range determination for adaptive quantization, the challenges of managing large video data sizes are addressed, resulting in improved compression efficiency and reduced resource usage in video encoding and decoding systems.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- RUIZ COLL DAMIAN
- Filing Date
- 2025-10-30
- Publication Date
- 2026-05-07
AI Technical Summary
Existing video encoding and decoding technologies face challenges in efficiently managing large data sizes associated with video sequences, leading to significant resource requirements for storage and transmission, and there is a need for improved adaptive clipping techniques to enhance compression efficiency.
The implementation of selective reference range determination for adaptive quantization, which involves determining a target range for clipping based on the reference range and video ranges, allowing for improved adaptive quantization and clipping processes in video encoding and decoding systems.
This approach enhances compression efficiency by optimizing the bitstream generation and decoding processes, reducing resource requirements while maintaining video quality.
Smart Images

Figure US2025053243_07052026_PF_FP_ABST
Abstract
Description
Docket No.: 24-2054PCTTITLESelective Reference Range for Adaptive Video Sample ClippingCROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application claims the benefit of U.S. Provisional Application No. 63 / 714,093, filed October 30, 2024, which is hereby incorporated by reference in its entirety.BRIEF DESCRIPTION OF THE DRAWINGS
[0002] Some features are shown by way of example, and not by limitation, in the accompanying drawings. In the drawings, like numerals reference similar elements.
[0003] FIG. 1 shows an example video coding / decoding system in which embodiments of the present disclosure may be implemented.
[0004] FIG. 2 shows an example encoder in which embodiments of the present disclosure may be implemented.
[0005] FIG. 3 shows an example decoder in which embodiments of the present disclosure may be implemented.
[0006] FIG. 4 shows an example quadtree partitioning of a coding tree block (CTB).
[0007] FIG. 5 shows an example quadtree corresponding to the example quadtree partitioning of the CTB in FIG. 4.
[0008] FIG. 6 show examples of binary tree and ternary tree partitions.
[0009] FIG. 7A shows an example of combined quadtree and multi-type tree partitioning of a CTB.
[0010] FIG. 7B shows an example tree corresponding to the combined quadtree and multi-type tree partitioning of the CTB shown in FIG. 7A.
[0011] FIG. 8 shows an example of partitioning modes in AV1.
[0012] FIG. 9 shows an example set of reference samples determined for intra prediction of a current block.
[0013] FIG. 10A, FIG. 10B, and FIG. 10C show example intra prediction modes.
[0014] FIG. 11 shows an example of a current block and corresponding reference samples.
[0015] FIG. 12 shows an example of applying an intra prediction mode (e.g., an angular mode) for prediction of a current block.
[0016] FIG. 13A shows an example of inter prediction performed for a current block in a current picture.
[0017] FIG. 13B shows an example motion vector.
[0018] FIG. 14 shows an example of bi-prediction performed for a current block.
[0019] FIG. 15A shows example spatial candidate neighboring blocks relative to a current block being coded.
[0020] FIG. 15B shows example locations of two temporal, co-located blocks relative to a current block.
[0021] FIG. 16 shows an example of intra block copy (IBC).
[0022] FIG. 17 shows an example of intra template matching prediction (IntraTMP) for predicting or determining a current block, according to some embodiments.
[0023] FIG. 18 shows the video ranges (the full video range and the narrow video range) in relation to the range provided by the internal bit depth, according to some embodiments.Docket No.: 24-2054PCT
[0024] FIG. 19A shows an example of differences determined between the reference range and the range of actual pixel values, according to some embodiments.
[0025] FIG. 19B shows a flowchart of an example conventional method of adaptive quantization for use in clipping, according to some embodiments.
[0026] FIG. 20 shows an example of a target range for clipping in relation to the reference range and the video ranges when the reference range is set to the narrow video range, according to some embodiments.
[0027] FIG. 21 shows an example of a target range for clipping in relation to the reference range and the video ranges when the reference range is set to the full video range, according to some embodiments.
[0028] FIG. 22 shows an example of a threshold range for signaling a target range for clipping in relation to the reference range and another reference range, according to some embodiments.
[0029] FIG. 23 shows a flowchart of an example selective reference range determination for improved adaptive clipping, according to some embodiments.
[0030] FIG. 24A and FIG. 24B show an example of the improvement in delta values signaled in accordance with an embodiment.
[0031] FIG. 25 shows a flowchart of an example method for selective reference range determination for improved adaptive quantization performed at an encoder, according to some embodiments.
[0032] FIG. 26 shows a flowchart of an example method for selective reference range determination for improved adaptive quantization performed at an decoder, according to some embodiments.
[0033] FIG. 27 illustrates a block diagram of an example computer system in which embodiments of the present disclosure may be implemented.DETAILED DESCRIPTION
[0034] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the disclosure. However, it will be apparent to those skilled in the art that the disclosure, including structures, systems, and methods, may be practiced without these specific details. The description and representation herein are the common means used by those experienced or 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 circuitry have not been described in detail to avoid unnecessarily obscuring aspects of the disclosure.
[0035] References in the specification to “one embodiment,’’ “an embodiment,’’ “an example embodiment,” etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may not necessarily include the particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the art to affect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.
[0036] Also, it is noted that individual embodiments may be described as a process which is depicted as a flowchart, a flow diagram, a data flow diagram, a structure diagram, or a block diagram. Although a flowchart may describe theDocket No.: 24-2054PCT operations as a sequential process, many of the operations can be performed in parallel or concurrently. In addition, the order of the operations may be re-arranged. A process is terminated when its operations are completed, but could have additional steps not included in a figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc. When a process corresponds to a function, its termination can correspond to a return of the function to the calling function or the main function.
[0037] The term "computer-readable medium” includes, but is not limited to, portable or non-portable storage devices, optical storage devices, and various other mediums capable of storing, containing, or carrying instruction(s) and / or data. A computer-readable medium may include a non-transitory medium in which data can be stored and that does not include carrier waves and / or transitory electronic signals propagating wirelessly or over wired connections. Examples of a non- transitory medium may include, but are not limited to, a magnetic disk or tape, optical storage media such as compact disk (CD) or digital versatile disk (DVD), flash memory, memory or memory devices. A computer-readable medium may have stored thereon code and / or machine-executable instructions that may represent a procedure, a function, a subprogram, a program, a routine, a subroutine, a module, a software package, a class, or any combination of instructions, data structures, or program statements. A code segment may be coupled to another code segment or a hardware circuit by passing and / or receiving information, data, arguments, parameters, or memory contents. Information, arguments, parameters, data, etc. may be passed, forwarded, or transmitted via any suitable means including memory sharing, message passing, token passing, network transmission, or the like.
[0038] 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, the program code or code segments to perform the necessary tasks (e.g. , a computer-program product) may be stored in a computer-readable or machine-readable medium. A processor(s) may perform the necessary tasks.
[0039] A video sequence, comprising multiple pictures / frames, may be represented in digital form for storage and / or transmission. Representing a video sequence in digital form may require a large quantity of bits. Large data sizes that may be associated with video sequences may require significant resources for storage and / or transmission. Video encoding may be used to compress a size of a video sequence for more efficient storage and / or transmission. Video decoding may be used to decompress a compressed video sequence for display and / or other forms of consumption.
[0040] FIG. 1 shows an example video coding / decoding system 100 in which embodiments of the present disclosure may be implemented. Video coding / decoding system 100 comprises a source device 102, a transmission medium 104, and a destination device 106. The source device 102 encodes a video sequence 108 into a bitstream 110 for more efficient storage and / or transmission. The source device 102 may store and / or send / transmit the bitstream 110 to the destination device 106 via the transmission medium 104. The destination device 106 decodes the bitstream 110 to display the video sequence 108. The destination device 106 may receive the bitstream 110 from the source device 102 via the transmission medium 104. The source device 102 and / or the destination device 106 may be any of a plurality of different devices (e.g., a desktop computer, laptop computer, tablet computer, smart phone, wearable device, television, camera, video gaming console, set-top box, video streaming device, etc.).Docket No.: 24-2054PCT
[0041] The source device 102 may comprise (e.g., for encoding the video sequence 108 into the bitstream 110) one ormore of a video source 112, an encoder 114, and / or an output interface 116. The video source 112 may provide and / or generate the video sequence 108 based on a capture of a natural scene and / or a synthetically generated scene. A synthetically generated scene may be a scene comprising computer generated graphics and / or screen content. The video source 112 may comprise a video capture device (e.g., a video camera), a video archive comprising previously captured natural scenes and / or synthetically generated scenes, a video feed interface to receive captured natural scenes and / or synthetically generated scenes from a video content provider, and / or a processor to generate synthetic scenes.
[0042] A video sequence, such as the video sequence 108, may comprise a series of pictures (also referred to as frames). The video sequence may achieve an impression of motion based on successive presentation of pictures of the video sequence using a constant time interval or variable time intervals between the pictures. A picture may comprise one or more sample arrays of intensity values. The intensity values maybe taken (e.g., measured, determined, provided) at a series of regularly spaced locations within a picture. A color picture may comprise (e.g., typically comprises) a luminance sample array and two chrominance sample arrays. The luminance sample array may comprise intensity values representing the brightness (e.g., luma component, Y) of a picture. The chrominance sample arrays may comprise intensity values that respectively represent the blue and red components of a picture (e.g., chroma components, Cb and Cr) separate from the brightness. Other color picture sample arrays may be possible based on different color schemes (e.g., a red, green, blue (RGB) color scheme). A pixel, in a color picture, may refer to / comprise / be associated with all intensity values (e.g., luma component, chroma components), for a given location, in the sample arrays (e.g., three sample arrays are used for one luma component and two chroma components, respectively) used to represent color pictures. A monochrome picture may comprise a single, luminance sample array. A pixel, in a monochrome picture, may refer to / comprise / be associated with the intensity value (e.g., luma component) ata given location in the single, luminance sample array used to represent monochrome pictures.
[0043] The encoder 114 may encode the video sequence 108 into the bitstream 110. The encoder 114 may apply / use (e.g., to encode the video sequence 108) one or more prediction techniques to reduce redundant information in the video sequence 108. Redundant information is information that may be predicted at a decoder and need not be transmitted to the decoder for accurate decoding of the video sequence 108. For example, the encoder 114 may apply spatial prediction (e.g., intra-frame 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. The encoder 114 may partition pictures comprising the video sequence 108 into rectangular regions referred to as blocks, for example, before applying one or more prediction techniques. The encoder 114 may then encode a block using the one or more of the prediction techniques.
[0044] For temporal prediction, the encoder 114 may search for a block similar to the block being encoded in another picture (e.g., referred to as a reference picture) of the video sequence 108. The block determined during the search (e.g., 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 withinDocket No.: 24-2054PCT the same picture of the video sequence 108. A reconstructed sample refers to a sample that was encoded and then decoded. The ecoder 114 may determine a prediction error (e.g., also referred to as a residual) based on the difference between a block being encoded and a prediction block. The prediction error may represent non-redundant information that may be sent / transmitted to a decoder for accurate decoding of the video sequence 108.
[0045] The encoder 114 may apply a transform to the prediction error (e.g. using a discrete cosine transform (DCT), or any other transform) to generate transform coefficients. The encoder 114 may form the bitstream 110 based on the transform coefficients and other information used to determine prediction blocks using / based on prediction types, motion vectors, and / or prediction modes. The encoder 114 may perform one or more of quantization and entropy coding of the transform coefficients and / or the other information used to determine the prediction blocks, for example, before forming the bitstream 110. The quantization and / or the entropy coding may further reduce the quantity of bits needed to store and / or transmit the video sequence 108.
[0046] An output interface 116 may be configured to write and / or store the bitstream 110 onto the transmission medium 104 for transmission to the destination device 106. In addition or alternatively, the output interface 116 may be configured to send / transmit, upload, and / or stream the bitstream 110 to the destination device 106 via the transmission medium 104. The output interface 116 may comprise a wired and / or a wireless transmitter configured to send / transmit, upload, and / or stream the bitstream 110 in accordance with one or more proprietary, open-source, and / or standardized communication protocols (e.g., Digital Video Broadcasting (DVB) standards, Advanced Television Systems Committee (ATSC) standards, Integrated Services Digital Broadcasting (ISDB) standards, Data Over Cable Service Interface Specification (DOCSIS) standards, 3rd Generation Partnership Project (3GPP) standards, Institute of Electrical and Electronics Engineers (IEEE) standards, Internet Protocol (IP) standards, Wireless Application Protocol (WAP) standards, and / or any other communication protocol).
[0047] The transmission medium 104 may comprise wireless, wired, and / or computer readable medium. For example, the transmission medium 104 may comprise one or more wires, cables, air interfaces, optical discs, flash memory, and / or magnetic memory. In addition or alternatively, the transmission medium 104 may comprise one or more networks (e.g., the internet) or file servers configured to store and / or send / transmit encoded video data.
[0048] The destination device 106 may decode the bitstream 110 into the video sequence 108 for display. The destination device 106 may comprise one or more of an input interface 118, a decoder 120, and / or 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 In addition 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 comprise a wired and / or a wireless receiver configured to receive, download, and / or stream the bitstream 110 in accordance with one or more proprietary, open-source, standardized communication protocols, and / or any other communication protocol (e.g., such as referenced herein).
[0049] The decoder 120 may decode the video sequence 108 from the encoded bitstream 110. The decoder 120 may generate prediction blocks for pictures of the video sequence 108 in a similar manner as the encoder 114 andDocket No.: 24-2054PCT determine the prediction errors for the blocks, for example, to decode the video sequence 108. The decoder 120 may generate the prediction blocks using / based on prediction types, prediction modes, and / or motion vectors received in the bitstream 110. The decoder 120 may determine the prediction errors using the transform coefficients received in the bitstream 110. The decoder 120 may determine the prediction errors by weighting transform basis functions using the transform coefficients. The decoder 120 may combine the prediction blocks and the prediction errors to decode the video sequence 108. The video sequence 108 at the destination device 106 may be, or may not necessarily be, the same video sequence sent, such as the video sequence 108 as sent by the source device 102. The decoder 120 may decode a video sequence that approximates the video sequence 108, for example, because of lossy compression of the video sequence 108 by the encoder 114 and / or errors introduced into the encoded bitstream 110 during transmission to the destination device 106.
[0050] The video display 122 may display the video sequence 108 to a user. The video display 122 may comprise a cathode rate tube (CRT) display, a liquid crystal display (LCD), a plasma display, a light emitting diode (LED) display, and / or any other display device suitable for displaying the video sequence 108.
[0051] The video coding / decoding system 100 is merely an example and video encoding / decoding systems different from the video coding / decoding system 100 and / or modified versions of the video coding / decoding system 100 may similarly perform the methods and processes as described herein. For example, the video coding / decoding system 100 may comprise other components and / or arrangements. For example, the video source 112 may be external to the source device 102. Similarly, the video display 122 may be external to the destination device 106 or omitted altogether (e.g., if the video sequence 108 is intended for consumption by a machine and / or storage device). In an example, the source device 102 may further comprise a video decoderand the destination device 106 may further comprise a video encoder. For example, the source device 102 may be configured to further receive an encoded bitstream from the destination device 106 to support two-way video transmission between the devices.
[0052] The encoder 114 and / or the decoder 120 may operate according to one or more proprietary or industry video coding standards. For example, the encoder 114 and / or the decoder 120 may operate in accordance with one or more proprietary, open-source, and / or standardized protocols (e.g., International Telecommunications Union Telecommunication Standardization Sector (ITU-T) H.263, ITU-T H.264 and Moving Picture Expert 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)), the WebM VP8 andVP9 codecs, and / or AO Media Video 1 (AV1), and / or any other video coding protocol).
[0053] FIG. 2 shows an example encoder. An encoder 200 as shown in FIG. 2 may implement one or more processes described herein. The encoder 200 may encode a video sequence 202 into a bitstream 204 for more efficient storage and / or transmission. The encoder 200 may be implemented in the video coding / decoding system 100 as shown in FIG. 1 (e.g., as the encoder 114) or in any computing, communication, or electronic device (e.g., desktop computer, laptop computer, tablet computer, smart phone, wearable device, television, camera, video gaming console, set-top box, video streaming device, etc.). The encoder 200 may comprise one or more of an inter prediction unit 206, an intra predictionDocket No.: 24-2054PCT unit 208, combiners 210 and 212, a transform and quantization unit (TR + Q) 214, an inverse transform and quantization unit (iTR + iQ) 216, an entropy coding unit 218, one or more filters 220, and / or a buffer 222.
[0054] Encoder 200 may partition pictures (e.g., frames) of (e.g., comprising) video sequence 202 into blocks and encode video sequence 202 on a block-by-block basis. Encoder 200 may perform / apply a prediction technique on a block being encoded using either inter prediction unit 206 or intra prediction unit 208. Inter prediction unit 206 may perform inter prediction by searching for a block similar to the block being encoded in another, reconstructed picture (e.g., a reference picture) of video sequence 202. A reconstructed picture refers to a picture that was encoded and then decoded. The block determined during the search (e.g., referred to as a prediction block) may then be used to predict the block being encoded to remove redundant information. Inter prediction unit 206 may exploit temporal redundancy or similarities in scene contentfrom picture to picture in video sequence 202 to determine the prediction block. For example, scene content between pictures of video sequence 202 may be similar except for differences due to motion and / or affine transformation of the screen content over time.
[0055] Intra prediction unit 208 may perform intra prediction by forming a prediction block based on data from reconstructed neighboring samples of the block to be encoded within the same picture of video sequence 202. A reconstructed sample refers to a sample that was encoded and then decoded. Intra prediction unit 208 may exploit spatial redundancy or similarities in scene content within a picture of 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 immediate surrounding area of the region of the scene content in the same picture.
[0056] Combiner 210 may determine a prediction error (e.g., 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 sent / transmitted to a decoder for accurate decoding of video sequence 202.
[0057] Transform and quantization unit (TR + Q) 214 may transform and quantize the prediction error. Transform and quantization unit 214 may transform the prediction error into transform coefficients by applying, for example, a DCT to reduce correlated information in the prediction error. Transform and quantization unit 214 may quantize the coefficients by mapping data of the transform coefficients to a predefined set of representative values. Transform and quantization unit 214 may quantize the coefficients to reduce irrelevant information in bitstream 204. The irrelevant information refers to information that may be removed from the coefficients without producing visible and / or perceptible distortion in video sequence 202 after decoding (e.g., at a receiving device).
[0058] 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, entropy coding unit 218 may apply context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), and / or syntax-based context-based binary arithmetic coding (SBAC). The entropy coded coefficients may be packed to form bitstream 204.
[0059] Inverse transform and quantization unit (iTR + iQ) 216 may inverse quantize and inverse transform the quantized transform coefficients to determine a reconstructed prediction error. Combiner 212 may combine the reconstructed prediction error with the prediction block to form a reconstructed block. Filter(s) 220 may filter theDocket No.: 24-2054PCT reconstructed block, for example, using a deblocking filter, a sample-adaptive offset (SAO) filter, constrained directional enhancement filters (CDEFs), and / or loop restoration (LR) filters. Buffer 222 may store the reconstructed block for prediction of one or more other blocks in the same and / or different picture of video sequence 202.
[0060] Encoder 200 may further comprise an encoder control unit. The encoder control unit may be configured to control one or more units of encoder 200 as shown in FIG. 2. The encoder control unit may control the one or more units of encoder 200 such that bitstream 204 may be generated in conformance with the requirements of one or more proprietary coding protocols, industry video coding standards, and / or any other video cording protocol. For example, the encoder control unit may control the one or more units of encoder 200 such that bitstream 204 may be generated in conformance with one or more of ITU-T H.263, AVC, HEVC, WC, VP8, VP9, AV1, and / or any other video coding standard / format.
[0061] The encoder control unit may be configured to attempt to minimize (or reduce) the bitrate of bitstream 204 and / or maximize (or increase) the reconstructed video quality (e.g., within the constraints of a proprietary coding protocol, industry video coding standard, and / or any other video cording protocol). For example, the encoder control unit may be configured to attempt to minimize or reduce the bitrate of bitstream 204 such that the reconstructed video quality does not fall below a certain le vel / th resho Id , and / or to maximize or increase the reconstructed video quality such that the bitrate of bitstream 204 does not exceed a certain level / th reshold. The encoder control unit may determine / control one or more of: partitioning of the pictures of video sequence 202 into blocks, whether a block is inter predicted by inter prediction unit 206 or intra predicted by intra prediction unit 208, a motion vector for inter prediction of a block, an intra prediction mode among a plurality of intra prediction modes for intra prediction of a block, filtering performed by filter(s) 220, and / or one or more transform types and / or quantization parameters applied by transform and quantization unit 214. The encoder control unit may determine / control one or more of the above based on a rate-distortion measure for a block or picture being encoded. The encoder control unit may determine / control one or more of the above to reduce the rate-distortion measure for a block or picture being encoded.
[0062] The prediction type used to encode a block (intra or inter prediction), prediction information of the block (intra prediction mode if intra predicted, motion vector, etc.), and / or transform and / or quantization parameters, may be sent to entropy coding unit 218 to be further compressed (e.g., to reduce the bitrate). For example, entropy coding unit 218 may apply context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context-based binary arithmetic coding (SBAC), and / or symbol-to-symbol adaptive multi-symbol (non-binary) arithmetic coding to achieve further compression. The prediction type, prediction information, and / or transform and / or quantization parameters may be packed with the prediction error to form bitstream 204.
[0063] Encoder 200 is merely an example and encoders different from encoder 200 and / or modified versions of encoder 200 may perform the methods and processes as described herein. For example, encoder 200 may comprise other components and / or arrangements. One or more of the components shown in FIG. 2 may be optionally included in encoder 200 (e.g., entropy coding unit 218 and / or filters(s) 220).Docket No.: 24-2054PCT
[0064] FIG. 3 shows an example decoder. A decoder 300 as shown in FIG. 3 may implement one or more processes described herein. Decoder 300 may decode a bitstream 302 into a decoded video sequence 304 for display and / or some other form of consumption. Decoder 300 may be implemented in video coding / decoding system 100 in FIG. 1 and / or in a computing, communication, or electronic device (e.g., desktop computer, laptop computer, tablet computer, smart phone, wearable device, television, camera, video gaming console, set-top box, and / or video streaming device). Decoder 300 may comprise 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 prediction unit 316, and / or an intra prediction unit 318.
[0065] Decoder 300 may comprise a decoder control unit configured to control one or more units of decoder 300. The decoder control unit may control the one or more units of decoder 300 such that bitstream 302 is decoded in conformance with the requirements of one or more proprietary coding protocols, industry video coding standards, and / or any other communication protocol. For example, the decoder control unit may control the one or more units of decoder 300 such that the bitstream 302 is decoded in conformance with one or more of ITU-T H.263, AVC, HEVC, WC, VP8, VP9, AV1, and / or any other video coding standard / format.
[0066] The decoder control unit may determine / control one or more of: whether a block is inter predicted by inter prediction unit 316 or intra predicted by intra prediction unit 318, a motion vector for inter prediction of a block, an intra prediction mode among a plurality of intra prediction modes for intra prediction of a block, filtering performed by filter(s) 312, and / or one or more inverse transform types and / or inverse quantization parameters to be applied by inverse transform and quantization unit 308. One or more of the control parameters used by the decoder control unit may be packed in bitstream 302.
[0067] Entropy decoding unit 306 may entropy decode the bitstream 302. For example, entropy decoding unit 306 may apply context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), and syntax-based context-based binary arithmetic coding (SBAC) to decompress the prediction type used to encode a block (intra or inter prediction), prediction information of the block (intra prediction mode if intra predicted, motion vector, etc.), and transform and quantization parameters. Inverse transform and quantization unit 308 may inverse quantize and / or inverse transform the quantized transform coefficients to determine a decoded prediction error. Combiner 310 may combine the decoded prediction error with a prediction block to form a decoded block. The prediction block may be generated by intra prediction unit 318 or inter prediction unit 316 (e.g., as described above with respect to encoder 200 in FIG. 2). Filter(s) 312 may filter the decoded block, for example, using a deblocking filter, a sample-adaptive offset (SAO) filter, constrained directional enhancement filters (CDEFs), and / or loop restoration (LR) filters. Buffer 314 may store the decoded block for prediction of one or more other blocks in the same and / or different picture of the video sequence in bitstream 302. Decoded video sequence 304 may be output from filter(s) 312 as shown in FIG. 3.
[0068] Decoder 300 is merely an example and decoders different from decoder 300 and / or modified versions of decoder 300 may perform the methods and processes as described herein. For example, decoder 300 may have other components and / or arrangements. One or more of the components shown in FIG. 3 may be optionally included in decoder 300 (e.g., entropy decoding unit 306 and / or filters(s) 312).Docket No.: 24-2054PCT
[0069] Although not shown in FIGS. 2 and 3, each of encoder 200 and decoder 300 may further comprise an intra block copy unit in addition to inter prediction and intra prediction units The intra block copy unit may perform / operate similar to an inter prediction unit but may predict blocks within the same picture. For example, the intra block copy unit may exploit repeated patterns that appear in screen content. The screen content may include computer generated text, graphics, animation, etc.
[0070] Video encoding and / or decoding may be performed on a block-by-block basis. The process of partitioning a picture into blocks may be adaptive based on the content of the picture. For example, larger block partitions may be used in areas of a picture with higher levels of homogeneity to improve coding efficiency.
[0071] A picture (e.g., in HEVC, or any other coding standard / format) may be partitioned into non-overlapping square blocks, which may be referred to as coding tree blocks (CTBs). The CTBs may comprise samples of a sample array. A CTB may have a size of 2n x 2n samples, where n may be specified by a parameter of the encoding system. For example, n may be 4, 5, 6, or any other value. A CTB may have any other size. A CTB may be further partitioned by a recursive quadtree partitioning into coding blocks (CBs) of half vertical and half horizontal size. The CTB may form the root of the quadtree. A CB that is not split further as part of the recursive quadtree partitioning may be referred to as a leaf CB of the quadtree, and otherwise may be referred to as a non-leaf CB of the quadtree. A CB may have a minimum size specified by a parameter of the encoding system. For example, a CB may have a minimum size of 4 x 4, 8 x 8, 16 x 16, 32 x 32, 64 x 64 samples, or any other minimum size. A CB may be further partitioned into one or more prediction blocks (PBs) for performing inter and / or intra prediction. A PB may be a rectangular block of samples on which the same prediction type / mode may be applied. A CB may also be further partitioned into intra sub-partitions (ISP) where the reconstructed samples of each sub-partition are available to generate the prediction of the next sub-partition. For example, a CB may be split into 2 to 4 sub-partitions. For transformations, a CB may be partitioned into one or more transform blocks (TBs). A TB may be a rectangular block of samples that may determine / indicate an applied transform size.
[0072] FIG. 4 shows an example quadtree partitioning of a CTB 400. FIG. 5 shows an example quadtree 500 corresponding to the example quadtree partitioning of CTB 400 in FIG. 4. As shown in the examples of FIGS. 4 and 5, CTB 400 may first be partitioned into four CBs of half vertical and half horizontal size. Three of the resulting CBs of the first level partitioning of CTB 400 are leaf CBs. The three leaf CBs of the first level partitioning of CTB 400 are respectively labeled 7, 8, and 9 in FIGS. 4 and 5. The non-leaf CB of the first level partitioning of CTB 400 is partitioned into four sub- CBs of half vertical and half horizontal size. Three of the resulting sub-CBs of the second level partitioning of CTB 400 are leaf CBs. The three leaf CBs of the second level partitioning of CTB 400 are respectively labeled 0, 5, and 6 in FIGS. 4 and 5. Finally, The non-leaf CB of the second level partitioning of CTB 400 is partitioned into four leaf CBs of half vertical and half horizontal size. The four leaf CBs are respectively labeled 1, 2, 3, and 4 in FIGS. 4 and 5.
[0073] The example CTB 400 of FIG. 4 is partitioned into 10 leaf CBs respectively labeled 0-9, but may be partitioned into otherquantities of leaf CBs. The 10 leaf CBs may correspond to 10 CB leaf nodes (e.g., 10 CB leaf nodes of quadtree 500 as shown in FIG. 5). In other examples, a CTB may be partitioned into a different number of leaf CBs. The resultingDocket No.: 24-2054PCT quadtree partitioning of CTB 400 may be scanned using a z-scan (e.g left-to-right, top-to-bottom) to form the sequence order for encoding / decoding the CB leaf nodes. A numeric label (e.g , indicator, index) of each CB leaf node in FIGS. 4 and 5 may correspond to the sequence order for encoding / decoding. For example, CB leaf node 0 may be encoded / decoded first and CB leaf node 9 may be encoded / decoded last. Although not shown in FIGS. 4 and 5, each CB leaf node may comprise one or more PBs and / or TBs.
[0074] A picture, in WC (or in any other coding standard / format), may be partitioned in a similar manner (such as in HEVC). A picture may be first partitioned into non-overlapping square CTBs. The CTBs may then be partitioned, using a recursive quadtree partitioning, into CBs of half vertical and half horizontal size. A quadtree leaf node (e.g., in WC) may be further partitioned by a binary tree or ternary tree partitioning (or any other partitioning) into CBs of unequal sizes.
[0075] FIG. 6 shows example binary tree and ternary tree partitions. A binary tree partition may divide a parent block in half in either a vertical direction 602 or a horizontal direction 604. The resulting partitions may be half in size as compared to the parent block. In other examples, the resulting partitions may correspond to sizes that are less than and / or greater than half of the parent block size. A ternary tree partition may divide a parent block into three parts in either a vertical direction 606 or a horizontal direction 608. FIG. 6 shows an example in which the middle partition may be twice as large as the other two end partitions in the ternary tree partitions. In other examples, partitions may be of other sizes relative to each other and to the parent block. Binary and ternary tree partitions are examples of multi-type tree partitioning. Multi-type tree partitions may comprise partitioning a parent block into other quantities of smaller blocks. The block partitioning strategy (e.g., in WC) may be referred to as a combination of quadtree and multi-type tree partitioning (quadtree + multi-type tree partitioning) because of the addition of binary and / or ternary tree partitioning to quadtree partitioning.
[0076] FIG. 7A shows an example of combined quadtree and multi-type tree partitioning of a CTB 700A. FIG. 7B shows an example tree 700B corresponding to the combined quadtree and multi-type tree partitioning of CTB 700A shown in FIG. 7A. In both FIGS. 7Aand 7B, quadtree splits are shown in solid lines and multi-type tree splits are shown in dashed lines. For ease of explanation, CTB 700A is shown with the same quadtree partitioning as the CTB 400 described in FIG. 4, and a description of the quadtree partitioning of CTB 700A, which is similar to that for CTB 400, is omitted. The quadtree partitioning of the CTB 700A is merely an example and a CTB may be quadtree partitioned in a manner different from the CTB 700A. Additional multi-type tree partitions of CTB 700A maybe made relative to three leaf CBs shown in FIG. 4. The three leaf CBs in FIG. 4 that are shown in FIG. 7A as being further partitioned may be leaf CBs 5, 8, and 9. The three leaf CBs may be further partitioned using one or more binary and / or ternary tree partitions.
[0077] The leaf CB 5 of FIG. 4 may be partitioned into two CBs based on a vertical binary tree partitioning. The two resulting CBs may be leaf CBs respectively labeled 5 and 6 in FIGS. 7A and 7B. The leaf CB 8 of FIG. 4 may be partitioned into three CBs based on a vertical ternary tree partition. Two of the three resulting CBs may be leaf CBs respectively labeled 9 and 14 in FIGS. 7A and 7B. The remaining, non-leaf CB may be partitioned first into two CBs based on a horizontal binary tree partition. One of the two CBs may be a leaf CB labeled 10. The other of the two CBs may be further partitioned into three CBs based on a vertical ternary tree partition. The resulting three CBs maybe leaf CBs respectivelyDocket No.: 24-2054PCT labeled 11, 12, and 13 in FIGS. 7 A and 7B. The leaf CB 9 of FIG. 4 may be partitioned into three CBs based on a horizontal ternary tree partition. Two of the three CBs may be leaf CBs respectively labeled 15 and 19 in FIGS. 7A and 7B. The remaining, non-leaf CB may be partitioned into three CBs based on another horizontal ternary tree partition. The resulting three CBs may all be leaf CBs respectively labeled 16, 17, and 18 in FIGS. 7A and 7B.
[0078] Altogether, CTB 700A may be partitioned into 20 leaf CBs respectively labeled 0-19. The 20 leaf CBs may correspond to 20 leaf nodes (e.g., 20 leaf nodes of tree 700B shown in FIG. 7B). The resulting combination of quadtree and multi-type tree partitioning of the CTB 700A may be scanned using a z-scan (left-to-right, top-to-bottom) to form the sequence order for encoding / decoding the CB leaf nodes. A numeric label of each CB leaf node in FIGS. 7A and 7B may correspond to the sequence order for encoding / decoding, with CB leaf node 0 encoded / decoded first and CB leaf node 19 encoded / decoded last. Although not shown in FIGS. 7A and 7B, it should be noted that each CB leaf node may comprise one or more PBs and / or TBs.
[0079] A coding standard / format (e.g., HEVC, WC, or any other coding standard / format) may define various units (e.g., in addition to specifying various blocks (e.g., CTBs, CBs, PBs, TBs)). Blocks may comprise a rectangular area of samples in a sample array. Units may comprise the collocated blocks of samples from the different sample arrays (e.g., luma and chroma sample arrays) that form a picture as well as syntax elements and prediction data of the blocks. A coding tree unit (CTU) may comprise the collocated CTBs of the different sample arrays and may form a complete entity in an encoded bitstream. A coding unit (CU) may comprise the collocated CBs of the different sample arrays and syntax structures used to code the samples of the CBs. A prediction unit (PU) may comprise the collocated PBs of the different sample arrays and syntax elements used to predict the PBs. A transform unit (TU) may comprise TBs of the different samples arrays and syntax elements used to transform the TBs.
[0080] In some implementations of partitioning (e.g., AV1), a picture can be partitioned into multiple coding blocks. The largest coding blocks are also referred to as superblocks having sizes of either 128 x 128 or 64 x 64. Superblocks can be partitioned into smaller coding blocks which can be performed in nine partitioning modes. FIG. 8 shows the nine partitioning modes among which only PARTITIONJSPLIT allows recursive partitioning. In addition, PARTITION_VERT_4 and PARTITION_HORZ_4 modes are not allowed for 8 x 8 or 128 x 128 coding blocks, and T-shaped partitioning modes are not allowed for 8 x 8 coding blocks. The minimum coding block size is 4 x 4. Intra and inter coding blocks can be further partitioned into transform blocks and the partitioning depth is up to two levels.
[0081] A block may refer to any of a CTB, CB, PB, TB, CTU, CU, PU, and / or TU (e.g., in the context of HEVC, VVC, or any other coding format / standard). A block may be used to refer to similar data structures in the context of any video coding format / standard / protocol. For example, a block may refer to a macroblock in the AVC standard, a macroblock or a sub-block in the VP8 coding format, a superblock or a sub-block in the VP9 coding format, and / or a superblock or a sub-block (coding block or transform block) in the AV1 coding format.
[0082] In intra prediction, samples of a block to be encoded (e.g., also referred to as a current block) may be predicted from samples in a line of samples immediately adjacent to the current block. For example, the line of samples may include samples of the column immediately adjacent to the left-most column of the current block and samples of the rowDocket No.: 24-2054PCT immediately adjacent to the top-most row of the current block. The samples from the immediately adjacent column and row may be jointly referred to as reference samples. Each sample of the current block may be predicted (e.g., in an intra prediction mode) by projecting the position of the sample in the current block in a given direction to a point along the reference samples. The sample may be predicted by interpolating between the two closest reference samples of the projection point if the projection does not fall directly on a reference sample. A prediction error (e.g., referred to as a residual) may be determined for the current block based on differences between the predicted sample values and the original sample values of the current block.
[0083] Predicting samples and determining a prediction error based on a difference between the predicted samples and original samples may be performed (e.g., at an encoder) for a plurality of different intra prediction modes (e.g., including non-directional intra prediction modes). The encoder may select one of the plurality of intra prediction modes and its corresponding prediction error to encode the current block. The encoder may send an indication of the selected prediction mode and its corresponding prediction error to a decoder for decoding of the current block. The decoder may decode the current block by predicting the samples of the current block, using the intra prediction mode indicated by the encoder, and / or combining the predicted samples with the prediction error.
[0084] FIG. 9 shows an example set of reference samples 902 determined for intra prediction of a current block 904. Current block 904 may correspond to a block being encoded and / or decoded. Current block 904 may correspond to block 3 of partitioned CTB 700 as shown in FIG. 7A. As described herein, the numeric labels 0-19 of the blocks of partitioned CTB 700A may correspond to the sequence order for encoding / decoding the blocks and may be used as such in the example of FIG. 9.
[0085] In some embodiments, reference samples 902 may include a line of samples immediately adjacent to current block 904 and include samples from a column and a row immediately adjacent to current block 904. For example, the line of samples may include reference samples to the left and / or above current block 904. In some embodiments, reference samples 902 may be obtained (or selected) from a reference line of multiple reference lines (MRL), which may include a line of samples adjacent to current block 904 and also a line of non-adjacent samples. The MRL may include reference lines identified by corresponding reference line indices that indicate an i-th line of samples adjacent to current block 904 such that the O-th line indicates the reference line immediate adjacent (or closest) to current block 904 and a higher numbered i-th line indicates a line of samples further away from current block 904. An encoder may select a reference line from a set of MRL and signal an MLR index in the bitstream to indicate the selected reference line. For example, the encoder may signal a codeword encoding the MRL index. The decoder may decode the codeword to determine the MRL index that identifies a specific reference line used in intra prediction of current block 904.
[0086] For current block 904 that is w x h samples in size, reference samples 902 may comprise: 2 w samples (or any other quantity of samples) of an i-th row (e.g., indicated by an MRL index) adjacent to the top-most row of current block 904, 2h samples (or any other quantity of samples) of the i-th column adjacent to the left-most column of current block 904, and the top left neighboring corner sample(s) extending from the i-th column and i-th row with respect to current block 904. Current block 904 may be square, such that w = h - s. In other examples, a current block needDocket No.: 24-2054PCT not be square, such that w + h. Available samples from neighboring blocks of current block 904 may be used for constructing the set of reference samples 902 Samples may not be available for constructing the set of reference samples 902, for example, if the samples lie outside the picture of the current block, the samples are part of a different slice of the current block (e.g., if the concept of slices is used), and / or the samples belong to blocks that have been inter coded and constrained intra prediction is indicated. Intra prediction may not be dependent on inter predicted blocks, for example, if constrained intra prediction is indicated.
[0087] Samples that may not be available for constructing the set of reference samples 902 may comprise samples in blocks that have not already been encoded and reconstructed at an encoder and / or decoded at a decoder based on the sequence order for encoding / decoding. Restriction of such samples from inclusion in the set of reference samples 902 may allow identical prediction results to be determined at both the encoder and decoder. In the example of FIG. 9, samples from neighboring blocks 0, 1, 2, and 8 may be available to construct reference samples 902 given that these blocks are encoded and reconstructed at an encoder and decoded at a decoder prior to coding of current block 904. The samples from neighboring blocks 0, 1, 2, and 8 may be available to construct reference samples 902, for example, if there are no other issues (e.g., as mentioned above) preventing the availability of the samples from the neighboring blocks 0, 1, 2, and 8. The portion of reference samples 902 from neighboring block 6 may not be available due to the sequence order for encoding / decoding (e.g., because the block 6 may not have already been encoded and reconstructed at the encoder and / or decoded at the decoder based on the sequence order for encoding / decoding).
[0088] In some examples, unavailable samples from reference samples 902 may be filled with one or more of the available reference samples 902. For example, an unavailable reference sample may be filled with a nearest available reference sample. The nearest available reference sample may be determined by moving in a clock-wise direction through reference samples 902 from the position of the unavailable reference. The reference samples 902 maybe filled with the mid-value of the dynamic range of the picture being coded, for example, if no reference samples are available.
[0089] Samples of current block 904 may be intra predicted based on reference samples 902, for example, based on (e.g., after) determination and (optionally) filtering of reference samples 902. In some examples, a filtering scheme (e.g., a filtering algorithm) may be applied to reference samples 902 to improve prediction accuracy. The filtering scheme may be one of a plurality of filter types including at least: a smoothing filter (or reference sample smoothing filter) or an interpolation filter. In some examples, if reference samples of a given block are to be filtered, only one of the plurality of filter types is selected (e.g., activated) to be applied to the reference samples. For example, if the smoothing filter is selected (e.g., activated), the interpolation filter is not selected (e.g., disabled) or vice versa.
[0090] Many encoders / decoders may support a plurality of intra prediction modes in accordance with one or more video coding standards. For example, HEVC supports 35 intra prediction modes, including a planar mode, a direct current (DC) mode, and 33 angular modes. WC supports 67 intra prediction modes, including a planar mode, a DC mode, and 65 angular modes. Planar and DC modes may be used to predict smooth and gradually changing regions of a picture. Angular modes may be used to predict directional structures in regions of a picture. Any quantity of intra prediction modes may be supported.Docket No.: 24-2054PCT
[0091] FIGS. 10A-B show example intra prediction modes. FIG. 10A shows 35 intra prediction modes, such as supported by HEVC. The 35 intra prediction modes may be indicated / identified by indices 0 to 34. Prediction mode 0 may correspond to planar mode. Prediction mode 1 may correspond to DC mode. Prediction modes 2-34 may correspond to angular modes. Prediction modes 2-18 may be referred to as horizontal prediction modes because the principal source of prediction is in the horizontal direction. Prediction modes 19-34 may be referred to as vertical prediction modes because the principal source of prediction is in the vertical direction.
[0092] FIG. 10B shows 67 intra prediction modes, such as supported by WC. The 67 intra prediction modes may be indicated / identified by indices 0 to 66. Prediction mode 0 may correspond to planar mode. Prediction mode 1 corresponds to DC mode. Prediction modes 2-66 may correspond to angular modes. Prediction modes 2-34 may be referred to as horizontal prediction modes because the principal source of prediction is in the horizontal direction. Prediction modes 35- 66 may be referred to as vertical prediction modes because the principal source of prediction is in the vertical direction. Some of the intra prediction modes illustrated in FIG. 10B may be adaptively replaced by wide-angle directions because blocks in WC need not be squares.
[0093] In some implementations of intra prediction modes (e.g., as supported by AV1), the angular modes can be defined by specifying a set of nominal modes and a set of angle delta offsets can be defined around each of the nominal modes. For example, there may be eight nominal angular prediction modes each having a set of angle delta offsets indexed between -3 and +3 with the nominal angle located at 0. FIG. 10C shows the eight nominal modes (in solid arrows) and the set of angle delta offsets around the D67_PRED nominal angle (in dotted arrows). The prediction angle can be derived by adding the offset to the associated nominal angle. As a result, there are 56 angular modes in AV1. Note that for small blocks, such as 4 x 4, 4 x 8, and 8 x 4, only nominal angular modes are applied In addition to the 56 angular modes, there are five non-angular intra-prediction modes in AV1, including DC_PRED mode (averaging samples from reconstructed neighboring blocks), SMOOTH_V AND SMOOTH_H modes (using quadratic interpolation along the vertical and horizontal directions, respectively), SMOOTH mode (averaging the quadratic interpolation results along both directions), and Paeth mode (predicting each sample from its top, left and top left reference samples). Recursive intra-prediction modes may also be used where a coding block is divided into sub-blocks and each intrapredicted sub-block can be used to intra-predict the next sub-block.
[0094] FIG. 11 shows a current block 904 and corresponding reference samples 902 from FIG. 9. To further describe how intra prediction modes are applied to determine a prediction (e.g., a prediction block) of current block 904, FIG. 11 shows current block 904 and reference samples 902, from a reference line among a set of multiple reference lines (MRL) 908-912, in a two-dimensional x, y plane, where a sample may be referenced as p[x][y], To simplify the prediction process, reference samples 902 may be placed in two, one-dimensional arrays. The reference samples 902 belonging to a reference line I from the set of MRL 908-912, above the current block 904, may be placed in the one-dimensional array ref [x]: re / i[x] = p[-l + x] [ - Z], (x > 0). (1)Docket No.: 24-2054PCTThe reference samples 902 belonging to reference line I, to the left of current block 904, may be placed in the onedimensional array ref2[y]‘. ref2[y] = p[-Z] [-1 + y], (y > 0). (2)The variable / represents how many lines away the selected reference line is from current block. For example, if reference line #0 908 is selected, then / is set to 1 to indicate the reference line adjacent to current block 904. For example, if reference line #1 910 is selected, then / is set to 2. For example, if reference line #2912 is selected, then / is set to 3
[0095] In some examples, if MRL is not activated or selected, then reference samples 902 may be from reference line #0908 that is immediately adjacent to current block 904. In this example, the variable / in Equations (1) and (2) is set to 1.
[0096] The prediction process may comprise determination of a predicted sample p[x][y] (e.g., a predicted value) at a location [x] [y] in current block 904. For planar mode, a sample at the location [x] [y] in current block 904 may be predicted by determini ng / calcu lating the mean of two interpolated values. The first of the two interpolated values may be based on a horizontal linear interpolation at the location [x] [y] in current block 904. The second of the two interpolated values may be based on a vertical linear interpolation at location [x][y] in current block 904. The predicted sample p [x] [y] in current block 904 may be determined / calculated as:where h[x] [y] = O - x - 1) ■ ref2\y] + (x + 1) - re / i[s] (4) may be the horizonal linear interpolation at the location [x] [y] in current block 904 and v[x] [y] = ($ - y - 1) ■ refi [x] + (y + 1) ■ ref2[s] (5) may be the vertical linear interpolation at the location [x] [y] in current block 904. In Equations (3), (4), and (5), s may be equal to a length of a side (e.g., a number of samples on a side) of current block 904.
[0097] For DC mode, a sample at a location [x][y] in current block 904 may be predicted by the mean of the reference samples 902. The predicted sample p [x] [y] in current block 904 may be determined / calculated as:
[0098] For angular modes, a sample at a location [x][y] in current block 904 may be predicted by projecting the location [x] [y] in a direction specified by a given angular mode to a point on the horizontal or vertical line of samples comprising reference samples 902. The sample at the location [x] [y] may be predicted by interpolating between the two closest reference samples of the projection point if the projection does not fall directly on a reference sample. The direction specified by the angular mode may be given by an angle p defined relative to the y-axis for vertical prediction modes (e.g., modes 19-34 in HEVC and modes 35-66 in WC). The direction specified by the angular mode may be given byDocket No.: 24-2054PCT an angle cp defined relative to the x-axis for horizontal prediction modes (e.g. , modes 2-18 in HEVC and modes 2-34 in WC).
[0099] FIG. 12 shows an example of applying an intra prediction mode (e.g., an angular mode such as vertical prediction mode 906) for prediction of current block 904. FIG. 12 specifically shows prediction of a sample at a location [x] [y] in current block 904 for vertical prediction mode 906. Vertical prediction mode 906 may be given by an angle <p with respect to the vertical axis. The location [x] [y] in current block 904, in vertical prediction modes, may be projected to a point (e.g., referred to as a projection point) on the horizontal line of reference samples ref [x]. Reference samples 902 are only partially shown in FIG. 12 and shown as being from a reference line with reference line index of 0 for ease of illustration. Reference samples 902 may be from another reference line of the set of MRL, as explained in FIG. 9. As shown in FIG 12, the projection point on the horizontal line of reference samples ref [x] may not be exactly on a reference sample. A predicted sample p[x][y] in current block 904 may be determined / calculated by linearly interpolating between the two reference samples, for example, if the projection point falls at a fractional sample position between two reference samples. The predicted sample p [x] [y] may be determined / calculated as: p[x][y] = (1 - if) ■ re j[x + i;+ 1] + if■ ref^x + i;+ 2], (7)In Equation (7), itmay be the integer part of the horizontal displacement of the projection point relative to the location [x] [y] . In Equation (7), i, may be determined / calculated as a function of the tangent of the angle <p of vertical prediction mode 906 as: it = L(y + 1) ’ tan <pj. (8)In Equation (7), ifmay be the fractional part of the horizontal displacement of the projection point relative to the location [x] [y] and may be determined / calculated as: if = ((y + 1) ■ tan <p) - [(y + 1) ■ tan <p ], (9) where [ ■ J is the integer floor function.
[0100] For horizontal prediction modes, a location [x][y] of a sample in current block 904 may be projected onto the vertical line of reference samples ref2\y]. A predicted sample p[x] [y] for horizontal prediction modes may be determined / calculated as: p[x][y] = (1 - if) ■ ref2\y + i, + 1] + if ref2[y + i;+ 2], (10)In Equation (10), i;may be the integer part of the vertical displacement of the projection point relative to the location [x] [y]. In Equation (10), i;may be determined / calculated as a function of the tangent of the angle p of the horizontal prediction mode as: ij = [(x + 1) - tan <pj. (11)In Equation (10), ifmay be the fractional part of the vertical displacement of the projection point relative to the location [x] [y] . In Equation (10), ifmay be determined / calculated as: if = ((x + 1) ■ tan p~) - [(x + 1) ■ tan <p\, (12) where [ ■ J is the integer floor function.Docket No.: 24-2054PCT
[0101] The interpolation functions given by Equations (7) and (10) may be implemented by an encoder and / or a decoder (e.g. , encoder 200 in FIG. 2 and / or decoder 300 in FIG. 3). The interpolation functions may be implemented by finite impulse response (FIR) filters. For example, the interpolation functions maybe implemented as a set of two-tap FI filters. The coefficients of the two-tap FIR filters may be respectively given by (1 - ) and if. The predicted sample p [x] [y] , in angular intra prediction, may be calculated with some predefined level of sample accuracy (e.g., 1 / 32 sample accuracy, or accuracy defined by any other metric). For 1 / 32 sample accuracy, the set of two-tap FIR interpolation filters may comprise up to 32 different two-tap FIR interpolation filters — one for each of the 32 possible values of the fractional part of the projected displacement if. In other examples, different levels of sample accuracy may be used.
[0102] In some examples, the FIR filters may be used for predicting chroma samples and / or luma samples. For example, the two-tap interpolation FIR filter may be used for predicting chroma samples and a same and / or a different interpolation technique / filter may be used for luma samples. For example, a four-tap FIR filter may be used to determine a predicted value of a luma sample. Coefficients of the four tap FIR filter may be determined based on if(e.g., similar to the two-tap FIR filter). For 1 / 32 sample accuracy, a set of 32 different four-tap FIR filters may comprise up to 32 different four-tap FIR filters — one for each of the 32 possible values of the fractional part of the projected displacement if. In other examples, different levels of sample accuracy may be used. The set of four-tap FIR filters may be stored in a lookup table (LUT) and referenced based on if. A predicted sample p[x] [y] , for vertical prediction modes, may be determined based on the four-tap FIR filter as:where T[i], i = 0, •••, 3, maybe the filter coefficients, and Idx is integer displacement. A predicted sample p[x][y], for horizontal prediction modes, may be determined based on the four-tap FIR filter as:3(14) p[x][y] = y fT[i] ■ ref2[y + ildx + i]. i=0
[0103] Supplementary reference samples may be determined / constructed if the location [x][y] of a sample in current block 904 to be predicted is projected to a negative x coordinate The location [x] [y] of a sample may be projected to a negative x coordinate, for example, if negative vertical prediction angles <p are used. The supplementary reference samples may be determined / constructed by projecting the reference samples in ref2[y] in the vertical line of reference samples 902 to the horizontal line of reference samples 902 using the negative vertical prediction angle <p. Supplementary reference samples may be similarly determined / constructed, for example, if the location [x][y] of a sample in current block 904 to be predicted is projected to a negative y coordinate. The location [x] [y] of a sample may be projected to a negative y coordinate, for example, if negative horizontal prediction angles p are used. The supplementary reference samples may be determined / constructed by projecting the reference samples in ref^x] on the horizontal line of reference samples 902 to the vertical line of reference samples 902 using the negative horizontal prediction angle <p.Docket No.: 24-2054PCT
[0104] An encoder may determine / predict samples of a current block being encoded (e.g., current block 904) for a plurality of intra prediction modes (e.g., using one or more of the functions described herein). For example, an encoder may determine / predict samples of a current block for each of 35 intra prediction modes in HEVC and / or 67 intra prediction modes in WC and / or including extended intra prediction modes from WAIP for rectangular blocks. The encoder may determine, for each intra prediction mode applied, a corresponding prediction error for the current block based on a difference (e.g., sum of squared differences (SSD), sum of absolute differences (SAD), or sum of absolute transformed differences (SATD)) between the prediction samples, generated from reference samples 902 of a reference line (e.g., from a set of MRL), determined for the intra prediction mode and the original samples of the current block. The encoder may determine / select one of the intra prediction modes to encode the current block based on the determined prediction errors. For example, the encoder may determine / select one of the intra prediction modes that results in the smallest prediction error for the current block. In some examples, the encoder may determine / select the intra prediction mode and the associated reference line to encode the current block based on a rate-distortion measure (e.g., Lagrangian ratedistortion cost) determined using the prediction errors. The encoder may signal, in the bitstream to a decoder for decoding of the current block, an indication of the determined / selected intra prediction mode and an indication of the associated MRL index (which may indicate a reference line index). The encoder may also signal in the bitstream to the decoder a corresponding prediction error (e.g., residual) of the intra prediction mode.
[0105] A decoder may determine / predict samples of a current block being decoded (e.g., current block 904) for an intra prediction mode. For example, a decoder may receive an indication of a reference line (e.g., a reference line index or an MRL index associated with the reference line index) and an intra prediction mode (e.g., an angular intra prediction mode) from an encoder for a current block. The decoder may retrieve a set of reference samples and perform intra prediction based on the MRL index and the intra prediction mode indicated by the encoder for the current block in a similar manner (e.g., as described above for the encoder). For example, the decoder may obtain the reference samples from a reference line indicated / identified by the decoded MRL index. In some examples, when MRL is not enabled / acti vated / selected, the reference line has reference line index 0 and is immediately adjacent to the current block. In these examples, no indication of MRL index is signaled.
[0106] The decoder may add predicted values of the samples (e.g., determined based on the intra prediction mode) of the current block to a residual of the current block to reconstruct the current block. In some examples, a decoder need not receive an indication of an angular intra prediction mode from an encoder for a current block. Instead, the decoder may determine an intra prediction mode through other decoder-side means (e.g., by applying template-based intra mode derivation (TIMD) tool / technique).
[0107] While various examples herein correspond to intra prediction modes in HEVC and WC, the methods, devices, and systems as described herein may be applied to / used for other intra prediction modes (e.g., as used in other video coding standards / formats, such as VP8, VP9, AV1, etc.).
[0108] Intra prediction may exploit correlations between spatially neighboring samples in the same picture of a video sequence to perform video compression. Inter prediction is another coding tool that may be used to perform videoDocket No.: 24-2054PCT compression. Inter prediction may exploit correlations in the time domain between blocks of samples in different pictures of a video sequence. For example, an object may be seen across multiple pictures of a video sequence. The object may move (e.g. , by some translation and / or affine motion) or remain stationary across the multiple pictures. A current block of samples in a current picture being encoded may have / be associated with a corresponding block of samples in a previously decoded picture. The corresponding block of samples may accurately predict the current block of samples. The corresponding block of samples may be displaced from the current block of samples, for example, due to movement of the object, represented in both blocks, across the respective pictures of the blocks. The previously decoded picture may be a reference picture. The corresponding block of samples in the reference picture may be a reference block for motion compensated prediction. An encoder may use a block matching technique to estimate the displacement (or motion) of the object and / or to determine the reference block in the reference picture.
[0109] Similar to intra prediction, an encoder may determine a difference between a current block and a prediction for a current block. An encoder may determine a difference, for example, based on / after determining / generating a prediction for a current block (e.g., using inter prediction). The difference may be a prediction error (e.g., a residual). The encoder may store and / or send (e.g., signal), in / via a bitstream, the prediction error and / or other related prediction information. The prediction error and / or other related prediction information may be used for decoding and / or other forms of consumption. A decoder may decode the current block by predicting the samples of the current block (e.g., by using the related prediction information) and combining the predicted samples with the prediction error.
[0110] FIG. 13A shows an example of inter prediction. The inter prediction may be performed for current block 1300 in current picture 1302 being encoded. An encoder (e.g., encoder 200 as shown in FIG. 2) may perform inter prediction to determine and / or generate reference block 1304 in reference picture 1306. Reference block 1304 may be used to predict current block 1300. Reference pictures (e.g., reference picture 1306) may be prior decoded pictures available at the encoder and / or a decoder. Availability of a prior decoded picture may depend / be based on whether the prior decoded picture is available in a decoded picture buffer, at the time, current block 1300 is being encoded and / or decoded. The encoder may search the one or more reference pictures 1306 fora block (e.g., a candidate reference block) that is similar (or substantially similar) to current block 1300. The encoder may determine the best matching block from the blocks (e.g., candidate reference blocks) tested during the searching process. The best matching block may be reference block 1304. The encoder may determine that reference block 1304 is the best matching reference block based on one or more cost criteria. The one or more cost criteria may comprise a rate-distortion criterion (e.g., Lagrangian rate-distortion cost). The one or more cost criteria may be based on a difference (e.g., SSD, SAD, and / or SATD) between prediction samples of reference block 1304 and original samples of current block 1300.
[0111] The encoder may search for reference block 1304 within a reference region (e.g., a search range 1308). The reference region (e.g., search range 1308) maybe positioned around collocated block (or position) 1310, of current block 1300, in reference picture 1306. Collocated block 1310 may have a same position in reference picture 1306 as current block 1300 in current picture 1302. The reference region (e.g., search range 1308) may at least partially extend outside of reference picture 1306. Constant boundary extension may be used, for example, if the reference region (e.g., searchDocket No.: 24-2054PCT range 1308) extends outside of reference picture 1306. The constant boundary extension may be used such that values of the samples in a row or a column of reference picture 1306, immediately adjacent to a portion of the reference region (e.g., search range 1308) extending outside of reference picture 1306, may be used for sample locations outside of reference picture 1306. A subset of potential positions, or all potential positions, within the reference region (e.g., search range 1308) may be searched for reference block 1304. The encoder may utilize one or more 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 (e.g., motion vector 1312) to current block 1300.
[0112] One or more reference pictures may be searched by the encoder during inter prediction to determine and / or generate the best matching reference block. The reference pictures searched by the encoder may be included in (e.g., added to) one or more reference picture lists. For example, in HEVC and WC (and / or in one or more other communication protocols), two reference picture lists may be used (e.g., a reference picture list 0 and a reference picture list 1). A reference picture list may include one or more pictures. Reference picture 1306 of reference block 1304 may be indicated by a reference index pointing into a reference picture list comprising reference picture 1306. The reference frames can include different types of frames. For example, in some implementations (e.g., such as in AV1), up to seven frames can be used as reference frames and there are four types of frames, including LAST frame (a frame that was displayed in the near past), BWD frame ( a frame that will be displayed in the future), GOLDEN frame (a frame that was displayed in the distant past), and ARF frame (a frame from either the past or the future).
[0113] FIG. 13B shows an example motion vector. A displacement between reference block 1304 and current block 1300 may be interpreted as an estimate of the motion between reference block 1304 and current block 1300 across their respective pictures. The displacement maybe represented by motion vector 1312. For example, motion vector 1312 may be indicated by a horizontal component (MVx) and a vertical component (MVy) relative to the position of current block 1300. A motion vector (e.g., motion vector 1312) may have fractional or integer resolution. A motion vector with fractional resolution may point between two samples in a reference picture to provide a better estimation of the motion of current block 1300. For example, a motion vector may have 1 / 2, 1 / 4, 1 / 8, 1 / 16, 1 / 32, or any other fractional sample resolution. Interpolation between the two samples at integer positions may be used to generate a reference block and its corresponding samples at fractional positions, for example, if a motion vector points to a non-integer sample value in the reference picture. The interpolation may be performed by a filter with two or more taps.
[0114] The encoder may determine a difference (e.g., a corresponding sample-by-sample difference) between reference block 1304 and current block 1300 The encoder may determine the difference between reference block 1304 and current block 1300, for example, based on / after reference block 1304 is determined and / or generated, using inter prediction, for current block 1300. The difference may be a prediction error (e.g., a residual). The encoder may store and / or send (e.g., signal), in / via a bitstream, the prediction error and / or related motion information. The prediction error and / or the related motion information may be used for decoding (e.g., decoding current block 1300) and / or other forms of consumption. The motion information may comprise motion vector 1312 and a reference indicator / index. The reference indicator may indicate reference picture 1306 in a reference picture list. In other examples, the motion information mayDocket No.: 24-2054PCT comprise an indication of motion vector 1312 and / or an indication of the reference indicator / index. The reference indicator may indicate reference picture 1306 in the reference picture list comprising reference picture 1306. A decoder may decode current block 1300 by determining and / or generating reference block 1304, which may correspond to / form (e.g., be considered as) a prediction of current block 1300. The decoder may determine and / or generate reference block 1304, for example, based on the related motion information. The decoder may decode current block 1300 based on combining the prediction (e.g., a reference block) with the prediction error (e.g., a residual block).
[0115] Inter prediction, as shown in FIG. 13A, may be performed using one reference picture 1306 as a source of a prediction for current block 1300. Inter prediction based on a prediction of a current block using a single picture may be referred to as uni-prediction or single reference inter prediction.
[0116] Inter prediction of a current block, using bi-prediction or compound prediction, may be based on two pictures (e g., the source of prediction may be from the two pictures). Bi-prediction may be useful, for example, if a video sequence comprises fast motion, camera panning, zooming, and / or scene changes. Bi-prediction also may be useful to capture fade outs of one scene or fade outs from one scene to another, where two pictures may effectively be displayed simultaneously with different levels of intensity.
[0117] One or both of uni-prediction and bi-prediction may be available / used for performing inter prediction (e.g., at an encoder and / or at a decoder). Performing a specific type of inter prediction (e.g., uni-prediction / single reference prediction and / or bi-prediction / compound prediction) may depend on a slice type of current block. For example, for P slices, only uni-prediction may be available / used for performing inter prediction. For B slices, either uni-prediction or biprediction may be available / used for performing inter prediction. An encoder may determine and / or generate a reference block, for predicting a current block, from a reference picture list 0, for example, if the encoder is using uni-prediction. An encoder may determine and / or generate a first reference block, for predicting a current block, from a reference picture list 0 and determine and / or generate a second reference block, for predicting the current block, from a reference picture list 1 , for example, if the encoder is using bi-prediction.
[0118] FIG. 14 shows an example of bi-prediction / compound prediction. Two reference blocks 1402 and 1404 may be used to predict current block 1400. For example, reference block 1402 maybe in a reference picture of one of reference picture list 0 or reference picture list 1. Reference block 1404 may be in a reference picture of another one of reference picture list 0 or reference picture list 1. As shown in FIG. 14, reference block 1402 may be in a first picture that precedes (e.g., in time) a current picture of current block 1400, and reference block 1404 may be in a second picture that succeeds (e g., in time) the current picture of current block 1400. The first picture may precede the current picture in terms of a picture order count (POC) ora display order. The second picture may succeed the current picture in terms of the POC or the display order. In other examples, the reference pictures may both precede or both succeed the current picture in terms of POC or the display order. A POC may be / indicate an order in which pictures are output (e.g., from a decoded picture buffer). A POC may be / indicate an order in which pictures are generally intended to be displayed. Pictures that are output may not necessarily be displayed but may undergo different processing and / or consumption (e.g., transcoding). The two reference blocks determined and / or generated using / for bi-prediction may correspond to (e.g., beDocket No.: 24-2054PCT comprised in) a same reference picture. The reference picture may be included in both the reference picture list 0 and the reference picture list 1, for example, if the two reference blocks correspond to the same reference picture.
[0119] A configurable weight and / or offset value may be applied to one or more inter prediction reference blocks. An encoder may enable the use of weighted prediction using a flag in a picture parameter set (PPS) or a set of parameters at a similar level. The encoder may send / signal the weight and / or offset parameters in a slice segment header for current block 1400. Different weight and / or offset parameters may be sent / sig naled for luma and / or chroma components.
[0120] The encoder may determine and / or generate reference blocks 1402 and 1404 for current block 1400 using inter prediction. The encoder may determine a difference between current block 1400 and each of reference blocks 1402 and 1404. The differences may be prediction errors or residuals. The encoder may store and / or send / signal, in / via a bitstream, the prediction errors and / or their respective related motion information. The prediction errors and their respective related motion information may be used for decoding and / or other forms of consumption.
[0121] The motion information for reference block 1402 may comprise motion vector 1406 and / or a reference indicator / index. The reference indicator may indicate a reference picture, of reference block 1402, in a reference picture list. In some examples, the motion information for reference block 1402 may comprise an indication of motion vector 1406 and / or an indication of the reference index. The reference index may indicate the reference picture, of reference block 1402, in the reference picture list.
[0122] The motion information for reference block 1404 may comprise motion vector 1408 and / or a reference index / indicator. The reference indicator may indicate a reference picture, of reference block 1404, in a reference picture list. The motion information for reference block 1404 may comprise an indication of motion vector 1408 and / or an indication of the reference index. The reference index may indicate the reference picture, of reference block 1404, in the reference picture list.
[0123] A decoder may decode current block 1400 by determining and / or generating reference blocks 1402 and 1404. The decoder may determine and / or generate reference blocks 1402 and 1404, for example, based on the respective related motion information for reference blocks 1402 and 1404. Reference blocks 1402 and 1404 may correspond to / form (e.g., be considered as) the prediction (e.g., used to generate a prediction block) of current block 1400. The decoder may decode current block 1400 based on combining the prediction with the prediction errors.
[0124] Motion information may be predictively coded, for example, before being stored and / or sent / signaled in / via a bit stream (e.g., in HEVC, WC, and / or other video coding standards / formats / protocols). The motion information for a current block may be predictively coded based on motion information of one or more blocks neighboring the current block. The motion information of the neighboring block(s) may often correlate with the motion information of the current block because the motion of an object represented in the current block is often the same as (or similar to) the motion of objects in the neighboring block(s). Motion information prediction techniques (such as those in HEVC and WC) may comprise advanced motion vector prediction (AMVP) and / or inter prediction block merging (e.g., merge mode).
[0125] An encoder (e.g., encoder 200 as shown in FIG. 2), may code a motion vector. The encoder may code the motion vector (e.g., using AMVP) as a difference between a motion vector of a current block being coded and a motionDocket No.: 24-2054PCT vector predictor (MVP). An encoder may determine / select the MVP from a list of candidate MVPs. The candidate MVPs may be / correspond to previously decoded motion vectors of neighboring blocks in the current picture of the current block, and / or blocks at or near the collocated position of the current block in other reference pictures. The encoder and / or a decoder may reciprocally generate and / or determine the list of candidate MVPs.
[0126] The encoder may determine / select an MVP from the list of candidate MVPs. Then, the encoder may send / signal, in / via a bitstream, an indication of the selected MVP and / or a motion vector difference (MVD). The encoder may indicate the selected MVP in the bitstream using an index / indicator. The index may indicate the selected MVP in the list of candidate MVPs. The MVD may be determined / calculated based on a difference between the motion vector of the current block and the selected MVP. For example, fora motion vector (e.g., comprising a horizontal component (MVx) and a vertical component (MVy)) that indicates a position relative to a position of the current block being coded, the MVD may be represented by two components MVDXand MVDy. MVDXand MVDymay be determined / calculated as:MVD, = MV, - MVP,, (15)MVDy = MVy- MVPy (16)In Equations (15) and (16), MVDx and MVDy may respectively represent horizontal and vertical components of the MVD. In Equations (15) and (16), MVPx and MVPy may respectively represent horizontal and vertical components of the MVP.
[0127] A decoder (e.g., decoder 300 as shown in FIG. 3) may decode the motion vector by adding the MVD to the MVP indicated in / via the bitstream. The decoder may decode the current block by determining and / or generating the reference block. The decoder may determine and / or generate the reference block, for example, based on the decoded motion vector. The reference block may correspond to / form (e.g., be considered as) the prediction of the current block (e.g., a prediction block). The decoder may decode the current block by combining the prediction with the prediction error.
[0128] The list of candidate MVPs (e.g., in HEVC, WC, and / or one or more other communication protocols), for AMVP, may comprise two or more candidates (e.g., candidates A and B). Candidates A and B may comprise: up to two (or any other quantity of) spatial candidate MVPs determined / derived from five (or any other quantity of) spatial neighboring blocks of a current block being coded; one (or any other quantity of) temporal candidate MVP determined / derived from two (or any other quantity of) temporal, co-located blocks (e.g., if both of the two spatial candidate MVPs are not available or are identical); and / or zero motion vector candidate MVPs (e.g., if one or both of the spatial candidate MVPs or temporal candidate MVPs are not available) Other quantities of spatial candidate MVPs, spatial neighboring blocks, temporal candidate MVPs, and / or temporal, co-located blocks may be used for the list of candidate MVPs.
[0129] FIG. 15A shows example spatial candidate neighboring blocks for a current block. For example, five (or any other quantity of) spatial candidate neighboring blocks may be located relative to current block 1500 being encoded. The five spatial candidate neighboring blocks may be A0, A1, B0, B1, and B2. FIG. 15B shows temporal, co-located blocks for the current block. For example, two (or any other quantity of) temporal, co-located blocks may be located relative to current block 1500 being coded. The two temporal, co-located blocks may be CO and C1. The two temporal, co-located blocks may be in one or more reference pictures that may be different from the current picture of current block 1500.Docket No.: 24-2054PCT
[0130] An encoder (e.g., encoder 200 as shown in FIG. 2) may code a motion vector using inter prediction block merging (e.g., a merge mode). For example, the encoder (e.g., using merge mode) may reuse the same motion information of a neighboring block (e.g., one of neighboring blocks AO, A1, BO, B1, and B2) for inter prediction of a current block. For example, the encoder (e.g., using merge mode) may reuse the same motion information of a temporal, colocated block (e.g., one of temporal, co-located blocks CO and C1) for inter prediction of a current block. An MVD need not be sent (e.g., indicated, signaled) for the current block because the same motion information as that of a neighboring block or a temporal, co-located block may be used for the current block (e.g., at the encoder and / or a decoder). A signaling overhead for sending / signaling the motion information of the current block may be reduced because the MVD need not be indicated for the current block. The encoder and / or the decoder may reciprocally generate a candidate list of motion information from neighboring blocks or temporal, co-located blocks of the current block (e.g., in a manner similar to AMVP). The encoder may determine to use (e.g., inherit) motion information, of one neighboring block or one temporal, co-located block in the candidate list, for predicting motion information of the current block being coded. The encoder may signal / send, in / via a bitstream, an indication of the determined motion information from the candidate list. For example, the encoder may signal / send an indicator / index. The index may indicate the determined motion information in the list of candidate motion information. The encoder may signal / send the index to indicate the determined motion information.
[0131] A list of candidate motion information for merge mode (e.g., in HEVC, VVC, or any other coding formats / standards / protocols) may comprise: up to four (or any other quantity of) spatial merge candidates derived / determined from five (or any other quantity of) spatial neighboring blocks (e.g., as shown in FIG. 15A); one (or any other quantity of) temporal merge candidate derived from two (or any other quantity of) temporal, co-located blocks (e.g., as shown in FIG. 15B); and / or additional merge candidates comprising bi-predictive candidates and zero motion vector candidates. In some examples, the spatial neighboring blocks and the temporal, co-located blocks used for merge mode may be the same as the spatial neighboring blocks and the temporal, co-located blocks used for AMVP.
[0132] In some examples (e.g., AV1), a list of derived MV predictors may be generated by pooling the spatial and temporal MV candidates and ranking them based on weightings determined by evaluating each of the candidates. Up to four candidates may be added to the list of MV predictors, which may also be referred to as the dynamic reference list (DRL). The DRL may be used in dynamic MV prediction modes.
[0133] Inter prediction maybe performed in other ways and variants than those described herein. For example, motion information prediction techniques other than AMVP and merge mode may be used. While various examples herein correspond to inter prediction modes, such as used in HEVC and WC or AV1, the methods, devices, and systems as described herein may be applied to / used for other inter prediction modes (e.g., as used for other video coding standards / formats such as VP8, VP9, etc.). History-based motion vector prediction (HMVP), combined intra / inter prediction mode (CIIP) or compound inter-intra prediction, warped motion compensation, overlapped block motion compensation (OBMC), and / or merge mode with motion vector difference (MMVD) (e.g., as described in WC) may be performed / used and are within the scope of the present disclosure.Docket No.: 24-2054PCT
[0134] A block matching operation (or technique) may be applied / used (e.g., in inter prediction) to determine a reference block in a different picture than that of a current block being coded (e.g., encoded and / or decoded). A block matching operation also may be applied / used to determine a reference block in a same picture as that of a current block being coded. The reference block, in a same picture as that of the current block, as determined using block matching may often not accurately predict the current block (e.g., for camera captured videos). Prediction accuracy for screen content videos may not be similarly impacted, for example, if a reference block in the same picture as that of the current block is used for encoding. Screen content videos may comprise, for example, computer generated text, graphics, animation, etc. Screen content videos may comprise (e.g., may often comprise) repeated patterns (e.g., repeated patterns of text and / or graphics) within the same picture. Using a reference block (e.g., as determined using block matching), in a same picture as that of a current block being encoded, may provide efficient compression for screen content videos.
[0135] A prediction technique may be used (e.g., in HEVC, WC, AV1, and / or any other coding standards / formats / protocols) to exploit correlation between blocks of samples within a same picture (e.g., of screen content videos). The prediction technique may be intra block copy (I BC or IntraBC) or current picture referencing (C PR). An encoder may apply / use a block matching technique (e.g., similar to inter prediction) to determine a displacement vector (e.g., a block vector (BV)). The BV may indicate a relative position of a reference block (e.g., in accordance with intra block compensated prediction), that best matches the current block, from a position of the current block. For example, the relative position of the reference block may be a relative position of a top-left corner (or any other point / sample) of the reference block. The BV may indicate a relative displacement from the current block to the reference block that best matches the current block. The encoder may determine the best matching reference block from blocks tested during a searching process (e.g., in a manner similar to that used for inter prediction). The encoder may determine that a reference block is the best matching reference block based on one or more cost criteria. The one or more cost criteria may comprise a rate-distortion criterion (e.g., Lagrangian rate-distortion cost). The one or more cost criteria may be based on, for example, one or more differences (e.g., an SSD, an SAD, an SATD, and / or a difference determined based on a hash function) between the prediction samples of the reference block and the original samples of the current block. A reference block may correspond to / comprise prior decoded blocks of samples (e.g., reconstructed samples) of the current picture. The reference block may comprise decoded blocks of samples of the current picture prior to being processed by in-loop filtering operations (e.g., deblocking, SAO filtering, CDEFs, and / or LR filters). In some examples, the reference block may be restricted to a certain area. For example, in AV1 , if the top-left pixel coordinate of a superblock is (xO,yO), IntraBC prediction is available at pixel position (x,y) only if the value of the vertical coordinate y is less than yO and the value of the horizontal coordinate x is less xO + 2(y0 - y). Further, due to hardware write-back delays, the immediate reconstructed area may not be accessible by IntraBC prediction.
[0136] FIG. 16 shows an example of IBC (e.g., an IBC mode or an IntraBC mode). The example shown in FIG. 16 may correspond to screen content. The rectangular portions / sections with arrows beginning at their boundaries may be the current blocks being encoded. The rectangular portions / sections that the arrows point to may be the reference blocks for predicting the respective current blocks.Docket No.: 24-2054PCT
[0137] A reference block may be determined and / or generated, for a current block, using IBC. The encoder may determine a difference (e.g., a corresponding sample-by-sample difference) between the reference block and the current block. The difference may be a prediction error or residual. The encoder may store and / or send / signal, in / via a bitstream the prediction error and / or related prediction information. The prediction error and / or the related prediction information may be used for decoding and / or other forms of consumption. The prediction information may comprise a BV. The prediction information may comprise an indication of the BV. A decoder (e.g., decoder 300 as shown in FIG. 3), may decode the current block by determining and / or generating the reference block. The decoder may determine and / or generate the current block, for example, based on the prediction information (e.g., the BV). The reference block may correspond to / form (e.g., be considered as) the prediction (e.g., a prediction block) of the current block. The decoder may decode the current block by combining the prediction (e.g., prediction block) with the prediction error (e.g., residual or residual block).
[0138] A BV may be predictively coded (e.g., in HEVC, WC, and / or any other coding standards / formats / protocols) before being stored and / or sent / signaled in / via a bitstream. For example, the BV for a current block may be predictively coded based on a BV of one or more blocks neighboring the current block. For example, an encoder may predictively code a BV using the merge mode (e.g., in a manner similar to as described herein for inter prediction), AMVP (e.g., as described herein for inter prediction), or a technique similar to AMVP. The technique similar to AMVP may be BV prediction and difference coding (or AMVP for IBC).
[0139] An encoder (e.g., encoder 200 as shown in FIG. 2) performing BV prediction and coding may code a BV as a difference between the BV of a current block being coded and a block vector predictor (BVP). An encoder may select / determine the BVP from a list of candidate BVPs. The candidate BVPs may comprise / correspond to previously decoded BVs of neighboring blocks in the current picture of the current block. The encoder and / or a decoder may reciprocally generate or determine the list of candidate BVPs.
[0140] The encoder may send / signal, in / via a bitstream, an indication of the selected BVP and a block vector difference (BVD). The encoder may indicate the selected BVP in the bitstream using an index / indicator. The index may indicate (e.g., point to) the selected BVP in the list of candidate BVPs. The BVD may be determined / calculated based on a difference between a BV of the current block and the selected BVP. For example, for a BV (e.g., represented by a horizontal component (BV,) and a vertical component (BVy) that indicates a position relative to a position of the current block being coded, the BVD may be represented by two components BVDXand BVDy. BVD,. and B VDymay be determined / calculated as:BVD, = BV, - BVP,, (17)BVDy= BV, - BVPy. (18)In Equations (17) and (18), BVD., and BVDymay respectively represent horizontal and vertical components of the BVD. In Equations (17) and (18), BVPXand BVPymay respectively represent horizontal and vertical components of the BVP. A decoder (e.g., decoder 300 as shown in FIG. 3), may decode the BV by adding the BVD to the BVP indicated in / via the bitstream. The decoder may decode the current block by determining and / or generating the reference block. The decoderDocket No.: 24-2054PCT may determine and / or generate the reference block, for example, based on the decoded BV. The reference block may correspond to / form (e.g. , be considered as) the prediction (e.g . , a prediction block) of the current block. The decoder may decode the current block by combining the prediction (e.g., the prediction block) with the prediction error (e.g., residual or residual block).
[0141] A same BV as that of a neighboring block may be used for the current block and a BVD need not be separately signaled / sent for the current block, such as in the merge mode. A BVP (in the candidate BVPs), which may correspond to a decoded BV of the neighboring block, may itself be used as a BV for the current block. Not sending the BVD may reduce the signaling overhead.
[0142] A list of candidate BVPs (e.g., in HEVC, WC, and / or any other coding standard / format / protocol) may comprise two (or more) candidates. The candidates may comprise candidates A and B. Candidates A and B may comprise: up to two (or any other quantity of) spatial candidate BVPs determined / derived from five (or any other quantity of) spatial neighboring blocks of a current block being encoded; and / or one or more of last two (or any other quantity of) coded BVs (e.g., if spatial neighboring candidates are not available). Spatial neighboring candidates may not be available, for example, if neighboring blocks are encoded using intra prediction or inter prediction. Locations of the spatial candidate neighboring blocks, relative to a current block, being encoded using IBC may be illustrated in a manner similar to spatial candidate neighboring blocks used for coding motion vectors in inter prediction (e.g., as shown in FIG. 15A). For example, five spatial candidate neighboring blocks of a current block being coded using IBC may be respectively denoted AO, A1, BO, B1, and B2 as shown in FIG. 15A.
[0143] The most probable mode (MPM) refers to the intra prediction mode (IPM) that is most likely to be the best mode for the current block being encoded or decoded. In current intra prediction techniques, the MPM is determined by analyzing the intra prediction modes of the neighboring CDs (e.g., also referred to as blocks) of a current block (or CU) to be coded (e.g., encoded or decoded). For example, a list of 6 MPMs (referred to as the "MPM list”) may be constructed for intra prediction. The MPM list is derived from the intra prediction modes of the neighboring CDs, and is updated as the encoder progresses through the video frame. When encoding a block, the encoder may determine if the current block is a candidate for any of the MPMs in the MPM list. If it is, the encoder then compares the prediction errors of the respective MPMs to determine which MPM from the MPM list is the best mode for the current block. If the current block is not a candidate for any of the MPMs in the MPM list, the encoder may then evaluate remaining intra prediction modes (e.g., from a total of 67 intra prediction modes which may include a planar mode, a DC mode, and 65 angular directional modes) to determine the best mode for the current block.
[0144] The use of MPMs can significantly improve the coding efficiency because the encoder does not need to explicitly signal the intra prediction mode for the current block if it is one of the MPMs. Instead, the decoder can infer the intra prediction mode for the current block from the corresponding MPM list identically generated at the decoder. Thus, signaling overhead in the bitstream may be reduced.
[0145] In some examples, three types of intra modes may be considered to construct the MPM list: default intra modes; neighboring intra modes; and derived intra modes. A unified 6 MPM list may be used for intra blocks irrespectiveDocket No.: 24-2054PCT of whether Multiple Reference Lines (MRL) and Intra Sub-Partitions (ISP) coding tools are applied. The MPM list for the current block is constructed based on intra modes of the left neighbor block (e.g., block corresponding to A1 in FIG. 15A) and the above neighbor block (e.g., block corresponding to B1 in FIG. 15A) of the current block. Suppose the mode of the left neighbor block is denoted as Left and the mode of the above neighbor block is denoted as Above, the unified MPM list may be constructed as follows: when a neighboring block is not available, its intra mode is set to planar mode by default; if both modes Left and Above are non-angular modes, then the MPM list is set to include{planar, DC, V, H, V - 4, V + 4}, where “V” and “H” refer to vertical mode and horizontal mode, respectively; if one of modes Left and Above is an angular mode, and the other is non-angular, set a mode Max as the larger mode of Left and Above, and set MPM list to include {planar, Max, Max - 1, Max + 1, Max — 2, Max + 2}; if Left and Above are both angular and they are different, set a mode Max and a mode Min as the larger mode in Left and Above and as the smaller mode in Left and Above, respectively, and thereafter, if Max - Min is equal to 1, then set MPM list to include {planar, Left, Above, Min - 1, Max + 1 , Min - 2}, if Max - Min is greater than or equal to 62, then set MPM list to include {planar, Left, Above, Min + 1, Max - 1 , Min + 2}, if Max - Min is equal to 2, set MPM list to include {planar, Left, Above, Min + 1 , Min - 1 , Max + 1 }, or otherwise, set MPM list to include {planar, Left, Above, Min - 1 , -Min + 1 , Max - 1 }; and if Left and Above are both angular and they are the same, set MPM list to include {planar, Left, Left - 1 , Left + 1 , Left - 2, Left + 2}.
[0146] The encoder may encode an MPM index in the bitstream to indicate the position of the selected intra prediction mode in the MPM list to the decoder. The encoder may represent the MPM index as a codeword and entropy encode the codeword into the bitstream. The decoder may derive the MPM list in a manner identical to the encoder, and use the MPM index obtained from the codeword decoded from bitstream to obtain the intra prediction mode from the MPM list derived at the decoder. In some instances, the first bin of codeword, representing the MPM index, is context coded using an arithmetic coder (e.g., CABAC) so as to achieve additional coding efficiencies. For example, three contexts may be used, corresponding to whether the current intra block is MRL enabled, ISP enabled, or a normal intra block.
[0147] In some examples, during the 6 MPM list generation process, pruning may be used to remove duplicated intra modes so that the MPM list includes only unique intra modes. For entropy coding of the 61 non-MPM modes (that is, the 67 modes in WC minus the 6 MPM), a truncated binary code (TBC) may be used.
[0148] In some implementations, the MPM list is extended to include 16 additional candidates, and is divided into two parts, the primary MPM (PMPM) (e.g., including 6 entries) and the secondary (SMPM) (e.g., including 16 entries). In some implementations, the first entry in the general MPM list is the planar mode. The remaining entries include the intra modes of the adjacent neighboring blocks corresponding to positions left (L), above (A), below-left (BL), above-right (AR), and above-left (AL) (e.g., shown in FIG.15A as A1, B1, AO, BO, and B2), and decoder-side intra mode derivation (DIMD) modes which are sorted in ascending order of a cost such as, for example, SAD, SSD, SATD, etc. In some examples, up to a preconfigured / predetermined number of modes (e.g., 5) with the smallest costs are added to the MPM list. The cost for a respective MPM (e.g., an IPM corresponding to an entry in the MPM list) may be computed between the prediction of the reconstructed samples of the template of the current block and the reconstructed samples. For example, the prediction may be generated by applying the respective MPM for the template. Sorted directional modes are added intoDocket No.: 24-2054PCT the general MPM list, and then the default modes, until the general MPM list with 22 entries is constructed. In some examples, if a CU block is vertically oriented, the orderofneighboring blockscorresponds to A, L, BL, AR, AL; otherwise, it is L, A, AL, AR, BL.
[0149] Referring back to FIG. 16, in IBC mode applied for screen content, a reference block (RB) may be determined as a "best matching” reference block to a current block. For example, the arrows correspond to block vectors (BVs) that indicate respective displacements from respective current blocks (CBs) to respective reference blocks that best match the respective current blocks. In the examples shown in FIG. 16, the reference blocks match the respective current blocks and the calculated residuals would be small, if not zero. However, often, video content may be more efficiently encoded by considering symmetry properties. For example, it has been observed that symmetry is often present in video content, especially in text character regions and computer generated graphics in screen content video.
[0150] In some implementations, a Reconstruction-Reordered intra block copy IBC (RRIBC) mode (e.g., also referred to as I BC-Mirror Mode) is used for screen content video coding to take advantage of symmetry within video content to further improve the coding efficiency of IBC. In some examples, the RRIBC mode may be signaled based on IBC mode with an indication (or flag) indicating whether flipping is applied and if flipping is applied, further signaling an indication (or flag) indication a direction of flipping.
[0151] In some embodiments, when the RRIBC mode is indicated for encoding a current block, a residual for the current block may be calculated based on samples of a reference block (e.g., corresponding to an original reference block being encoded and decoded to form a reconstructed block) being flipped relative to the current block according to a flip direction indicated for the current block. In an example, at the encoder side, the current block (to be predicted) may be flipped before matching and residual calculation, while the reference block (used to predict the current block) may be derived without flipping. Similarly, at the decoder side, the current block (that was flipped at the encoder) may be determined based on the reference block and residual information, then flipped back to restore the original orientation of the current block before being flipped at the encoder side. In another example, instead of the current block being flipped, the reference block may be flipped instead such that the reference block is flipped to encode the current block (at the encoder) and flipped back (at the decoder) to restore the original orientation of the reference block at the encoder. As described in this specification, reference to flipping the current block may alternatively refer to flipping the reference block and not the current block such that the reference block and the current block are flipped in the direction with respect to each other.
[0152] In an example, in the RRIBC mode, the flip direction may include one of a horizontal direction (e.g , along an x-axis) ora vertical direction (e.g., along a y-axis) for RRIBC coded blocks. In an embodiment, fora current block coded in the RRIBC mode (e.g., an IBC advanced motion vector prediction (AMVP) coded block), a first indication (e.g., a first syntax flag) may indicate / signal whether to use flipping (e.g., also referred to as mirror flipping) to encode / decode the current block. Additionally, for the current block, a second indication (e.g., a second syntax flag) may indicate / signal the direction for flipping (e.g., vertical or horizontal). For IBC merge, the flip direction may be inherited from neighboringDocket No.: 24-2054PCT blocks, without syntax signaling. In an example, for RRIBC, flipping of a current block (or a reference block in an alternative embodiment) in a horizontal and a vertical direction can be represented in (19) and (20), respectively:Reference(x,y) = Sample(w - 1 - x,y) (19)Reference(x,y) = Sample (x, h - 1 - y) (20) where w and h are the width and heightof a current block, respectively. In Equations (19) and (20), Sample (x,y) may indicate a sample value located in (x,y). In Equations (19) and (20), Reference(x,y) may indicate a corresponding reference sample value after flipping. In other words, for horizontal flipping, Equation (19) shows that the current block is flipped in the horizontal direction by sampling from right to left. Similarly, for vertical flipping, Equation (20) shows that the current block is flipped in the vertical direction by sampling the current block from down to up.
[0153] Considering the horizontal or vertical symmetry, the current block and the reference block are normally aligned horizontally or vertically, respectively. Therefore, in an example, based on the RRIBC mode and a flipping direction, the reference block may be determined from a reference region (including candidate reference blocks) aligned in the same flipping direction, as will be further described below. As a result, when flipping in a horizontal direction is applied / indicated, the vertical component (BVy) of the BV (indicating a displacement from the current block to the reference block) may not need to be signaled because it may be inferred to be equal to 0 Similarly, when flipping in a vertical direction is applied / indicated, the horizontal component (BVX} of the BV may not need to be signaled because it may be inferred to be equal to 0. In other words, in an example, only one component, aligned with the direction for flipping, of the BV may be encoded and signaled for the current block.
[0154] For a current block coded in IBC mode, a BV for the current block may be constrained to indicate a relative displacement from the current block to a reference block within an IBC reference region. In some examples, a BVP used to predicatively code a BV may be similarly constrained. This is because a BVP may be derived from a BV of a spatially neighboring block of the current block or a prior coded BV as explained above. Based on the BVP, a BVD may be determined as a difference between the BV and the BVP. This BVD may be encoded and transmitted along with an indication of the selected BVP in a bitstream to enable decoding of the current block, as described above.
[0155] FIG. 17 shows an example of intra template matching prediction (IntraTMP) for predicting or determining a current block 1700, according to some embodiments. IntraTMP is an intra prediction mode that copies a reference block, from a reconstructed part of a current picture 1702 (e.g., current frame), whose template (e.g., an L-shaped template, above-only template, or left-only template) is determined to best match current template 1708 (e.g., the L-shaped template, above only template, or left-only template) of current block 1700 to predict current block 1700. Current block 1700 comprises a rectangular block of samples, in a picture or video frame of current picture 1702, to be encoded by the encoder or decoded by the decoder. Current template 1708 may be determined based on samples in a reconstructed region neighboring current block 1700. For example, current template 1708 may comprise samples that are adjacent to current block 1700 such as including one or more rows of samples above current block 1700 and / or and one or more columns of samples to the left of current block 1700. In some examples, the current template 1708 may be an L-shaped template, a top-only template, or a left-only template of the current block 1700. For example, the L-shaped template mayDocket No.: 24-2054PCT include the top-only template and the left-only template. For example, the L-shaped template may further include an above-left template.
[0156] In IntraTMP, a plurality of reference templates of respective candidate reference blocks 1714, from a predefined TMP search region 1706, are matched with current template 1708 to determine or select a reference template 1712 that best matches or is most similar to current template 1708. A reference block (RB) 1710 from the candidate reference blocks 1714 and indicated by the selected reference template 1712 may be used as a prediction block to determine or predict current block 1700. Block vector (BV) 1730 indicates a displacement from current block 1700 (e.g., the top left sample of current block 1700) to reference block 1710 (e.g., the top left sample of reference block 1710).
[0157] In some examples, TMP search region 1706 comprises a portion of a reconstructed region of current picture 1702. TMP search region 1706 indicates the regions that the encoder or decoder may search for candidate templates (such as candidate templates of candidate reference blocks 1714) to determine reference template 1712 and corresponding reference block 1710. In some examples, TMP search region 1706, may include region 1706A (R1) from a current CTU 1704, region 1706B (R3) including a portion of the above CTU, region 1706C (R2) including a portion of the above-left CTU, and region 1706D (R4) including a portion of the left CTU. The CTUs are a result of picture partitioning operations described above. It is to be understood that TMP search region 1706 may include other regions of reconstructed samples of current picture 1702.
[0158] In some examples, the dimensions of TMP search region 1706 (SearchRange_w, Search ange_h) may be set to be proportional to the dimensions of current block 1700 (BlkW, BlkH) to have a fixed number of cost comparisons (e.g., SAD) per pixel. For example, the dimensions of TMP search region 1706 may be calculated as follows:SearchRange_w = min (64, a * BlkW) (21)SearchRange_h = min (64, a * BlkH) (22)In Equations (21 ) and (22), a (or alpha) is a constant that controls a gal n / complexity trade-off for the encoder or decoder. For example, a may be equal to 5. In FIG. 17, it should further be noted that the dimensions of TMP search region 1706 are illustrated by example and not by limitation.
[0159] In some examples, the candidate templates of candidate reference blocks 1714 have the same shape and size as current template 1708. In an example, the candidate templates further have the same orientation as current template 1708. In some examples, matching templates include calculating a template matching (TM) cost between samples of a candidate reference template of a candidate RB (indicated by a respective candidate block vector) and corresponding samples of current template 1708. For example, the difference may be based on a sum of squared differences (SSD), a sum of absolute differences (SAD), a sum of absolute transformed differences (SATD), or a difference determined based on a hash function. The template matching cost represents a similarity between the templates with a smaller cost representing more similar templates.
[0160] In some examples, a position of each sample in TMP search region 1706 may be selected as a location of a candidate reference block whose respective reference template is compared against current template 1708 to determine a TM cost. The position may be indicated by a candidate block vector that represents a displacement from current blockDocket No.: 24-2054PCT1700 (e.g., a top-left sample of current block 1700) to the position. To speed up the template matching process, one or more of TMP search region 1706 may be subsampled by a subsampling interval (e.g., 3) such that not every position is considered as a location of a candidate reference block. After finding a set of candidates (e.g., to generate the list of candidates), a refinement process may be performed to select additional candidate block vectors. The refinement process may be performed via a second template matching search in a search region around one or more of the set of candidates. The search region maybe a reduced search range associated with the subsampling interval.
[0161] In some examples, based on the encoder selecting IntraTMP for coding the current block, the encoder may signal the usage of this mode, and the same prediction and matching operations are performed at the decoder.
[0162] In some examples, by performing template matching operations on candidate reference templates in TMP search regions 1706A-D, the decoder (and also encoder) may construct a candidate list of up to a predetermined maximum number (e.g., 19) of candidate block vectors (or candidate block vector predictors). These candidate block vectors may be in ascending order according to the template matching costs of respective reference templates of candidate reference blocks indicated by the candidate block vectors. In some examples, a prediction block (e.g., a predictor) of current block 1700 maybe generated using one or more of the reference blocks (e.g., reference block 1710) determined using IntraTMP as well as applying one or more optional filters. For example, the following modes may be supported: single predictor, fusion of multiple predictors, sub-pel precision, and linear filter model. In the single predictor mode, a single predictor is selected from the candidate list such as selecting reference block 1710. In the fusion of multiple predictors mode, multiple predictors are blended to derive the final prediction block such as selecting two or more candidate reference blocks 1714. The blending weights may be either computed from the template matching cost of each predictor, or with a Wiener-filter based weight derivation method. In the sub-pel precision mode, when a single predictor is used, sub-pel precision can be used with 1 / 2 -pel precision, 1 / 4-pel precision, or 3 / 4-pel precision, each with 8 possible directions. In the linear filter model mode, a linearfilter can be learned (e.g., generated or derived) between the reference template and current template and be applied to the reference block. This mode can be used for the single predictor when sub-pel precision is not used.
[0163] In the example illustrated in FIG. 17, reference template 1712 of reference block 1710 may be determined to best match current template 1708 based on the template matching cost between reference template 1712 and current template 1708 being a minimum TM cost. In another example, the encoder may select reference block 1710 as a prediction of current block 1700 and signal an index of a candidate block vector, indicating reference block 1710, in the candidate list. The decoder may generate the same candidate list and determine reference block 1710 based on decoding the index from the bitstream. A block vector (BV) may indicate the displacement of a reference block (e.g., reference block 1710) relative to the current block 1700.
[0164] In some examples, the IntraTMP mode may be enabled for blocks (e.g., CUs) with a size (e.g., width times height) less than or equal to a threshold size (e.g., 64). In an example, the threshold size for IntraTMP is configurable. The IntraTMP prediction mode may be signaled at a block (e.g., per CU) level through a dedicated flag.Docket No.: 24-2054PCT
[0165] In some examples, an encoder may determine a difference (e.g., a corresponding sample-by-sample difference) between current block 1700 and reference block 1710 used to predict current block 1700. The difference may be referred to as a prediction error or residual. The encoder may store and / or signal in a bitstream the prediction error or residual for decoding by a decoder.
[0166] To perform TMP to code current block 1700, a decoder may perform the same operations as the encoder as described above. For example, based on receiving an indication from the encoder that IntraTMP is used to predict current block 1700 (e.g., via a flag), the decoder may similarly determine or construct current template 1708 of current block 1700. After determining or constructing current template 1708, the decoder may further similarly search TMP search region 1706 to generate a list of candidates from which reference block 1710 may be determined. Because, in some examples, the reference block may be indicated by a block vector candidate with the lowest cost in the list of candidates, the decoder may obtain the block vector candidate by decoding, from the bitstream, the index of the block vector candidate in the list of candidates. The decoder may combine the residual, decoded from the bitstream, with reference block 1710 to reconstruct current block 1700. In this way, the encoder does not need to encode BV 1730 that indicates reference block 1710 in the bitstream.
[0167] In video standards, the bit depth (N) parameter indicates the number of bits that a sample of the luma and chroma components signal can use to represent a pixel of a picture. To facilitate handling pixel information of pictures, the luma and chroma values are always represented as a positive integer value between 0 and 2N.
[0168] The formats using a picture resolution of standard sefinition (SD) and formats with lower resolution typically use a bit depth of 8 bits, which indicates a maximum number of 256 levels (28). High definition (HD) and higher resolutions such as ultra-high definition (UHD) typically use a bit depth of 10 bits, allowing the extension of the number of luma and chroma levels to 1024 (210). Professional video formats used mainly in editing, color correction, and the visual effects stages normally use bit depths beyond 10 bits, such as 12 and 16 bits. Many of the video compression standards define additional profiles for high-bit-depth formats because these require particular adaptations in some of the encoding and decoding stages.
[0169] In WC, the video bit depth is a mandatory parameter that the encoder signals to the decoder through the sps_bitdepth_minus8 parameter (ITU-T H.266, (08 / 2020), "Versatile video coding”) in the sequence parameter set (SPS) syntax element. In some standards that use color spaces other than the YCbCr color space, the bit depths of the luma and chroma components may be signaled separately as distinct parameters (e.g., BitDepthy and BitDepthc, respectively).
[0170] In general, YCbCr color space is derived from the RGB component values representing a pixel. In this color space transform, the luma (E'y) and chrominance (E'PB and E'PR) component signals are obtained as real numbers. The parameter E'y= 0 is associated with nominal black and E'y= 1 is associated with nominal white. Likewise, E'PB = 0 and E'PR= 0 are associated with both nominal black and nominal white, and the range of both chroma components is ±0.5.
[0171] Scaling, offset, and rounding to integers are usually applied to achieve positive integer values for both the luma and chroma components. The type of scaling and offset applied to the luma and chroma components determine theDocket No.: 24-2054PCT range of these components, characterized by a nominal maximum (nominal white for the Y component) and a nominal minimum (nominal black for the Y component).
[0172] For historical reasons, the video industry uses two types of scaling and offsets, which determine two types of video ranges: the "full video range" and the “narrow video range”. The vui_full_range_flag parameter in the Video Usability Information (VUI) syntax element (ITU-T H.274 (V3) (09 / 2023), “Versatile supplemental enhancement information messages for coded video bitstreams”) signals the video range to the decoder.
[0173] When the vui_full_range_flag parameter is true (e.g. , vui_full_range_flag = 1), it indicates that the video range is the full video range. When the video range is the full video range, the nominal luma and chroma values use the entire range determined for the bit depth, ranging from 0 for the nominal minimum value to 2N- 1 for the nominal maximum value, where N is the bit depth. The luma and chroma values for the full video range are derived as follows (ITU-T H.273 (V3) (09 / 2023), "Coding-independent code points for video signal type identification”):Y = Round (((1 « B / fDepf / iy) - 1) * E )Cb = Round (((1 « BitDepthc) - 1) * E'Pe) + (1 « (BitDepthc - 1))Cr = Round (((1 « BitDepthc) - 1) * E'PR) + (1 « (BitDepthc ~ 1))
[0174] When the vui_full_range_flag is false, it indicates that the video range is the narrow video range that is smaller than the full video range. When the video range is the narrow video range, the nominal luma and chroma values are constrained, and consequently, the white peak and the black levels do not match with the minimum and maximum values of 0 to 2N- 1. In some examples, when the video range is the narrow video range, the luma and chroma values may be derived as follows:Y = Clip1Y( Round( ( 1 « ( BitDepthc - 8 ) ) * ( 235 * E + 16 ) ) )Cb = Cliplc ( Round( ( 1 « ( BitDepthc - 8 ) ) * ( 224 * E'Ps + 128 ) ) )Cr = Cliplc ( Round( ( 1 « ( BitDepthc - 8 ) ) * ( 224 * E'PR+ 128 ) ) )
[0175] In some example implementations of video coding, the vuiJulljangeJIag parameter is not mandatory, so the decoder is configured to decode a bitstream when the vui_full_range_flag is not present in the bitstream. For example, if the vui_full_range_flag parameter is absent, the decoder infers that the “narrow video range” is used and, for example, sets a reference range for reconstructed samples of a picture to the “narrow video range.”
[0176] Some encoding / decoding stages in the encoder and decoder may need a wider bit depth than the bit depth of the samples of the original picture. For instance, residual construction, which is the difference between the current and prediction blocks, may achieve negative values. If a sample in the current block is the black level (0) and the corresponding prediction sample is the white level (2N- 1), the residual sample will get a negative value of the white peak, demanding the same bit depth of N bits for a correct representation of the internal samples with negative values. A similar situation occurs in the output of the transform stage, where the transform coefficients may be negative and require a large dynamic range, for example, due to the discrete cosine and sine base functions used by transforms such as the discrete cosine transform (DCT) and the sine discrete transform (SDT).Docket No.: 24-2054PCT
[0177] FIG. 18 illustrates one example of video ranges for a picture using a video bit depth of 10 bits (N = 10) and an internal bit depth of 16 bits (M = 16). The nominal maximum and minimum for the "full video range” (maximum full video range 1802 and minimum full video range 1803) and the "narrow video range” (maximum narrow video range 1804 and minimum narrow video range 1805) are indicated, as well as the boundaries of the internal bit depth (maximum internal bit depth 1800 and minimum internal bit depth 1801). As shown in legend 1806, the ranges shown on the left may apply to a picture for which a 10-bit video bit depth (N = 10) and a 16-bit internal bit depth (M = 16) are specified. This yields an internal bit depth range of [32767, -32767], a full video range of [1023, 0] for each of Y, Cb, and Cr components, and may yield a narrow video range of [940, 64], [960, 64], and [960, 64] for Y, Cb, and Cr components, respectively. The internal bit depth may be dependent on the processor, and the range of the internal bit depth is larger than the full video range. It should be understood that the specific values in the ranges and the bit depths shown in FIG. 18 are shown as examples, and other values are possible.
[0178] In many video coding standards, some tools, such as inverse quantization and some of the post-processing filters, may produce reconstructed samples that will achieve values beyond the maximum and minimum bounds determined by the bit depth.
[0179] That is a primary reason why video coding standards include a clipping stage after the processing stages that may incur overflow and / or underflow of the picture sample dynamic range. For instance, WC includes clipping the prediction and reconstructed samples after stages such as the intra-prediction filtering, sampling, interpolation, adaptive loop filter (ALF), weighted prediction, and weighted combination. In WC, the clipping between 0 and 2BitDePth- 1 is applied to the samples in the weighted samples prediction for the geometric partitioning mode. For example, the prediction sample values are derived as follows: pbSamplesf x][y] = Clip3 ( 0, ( 1 « BitDepth ) - 1, ( predSamplesLAf x][ y] * wValue + predSamplesLBf x ][y]*(8- wValue ) + offset! ) » shift! ), where Clip3Q is a function to clip a value z between an upper bound of x and a lower bound of y, e.g.: x ifz < x y if z > yz otherwise.
[0180] A similar clipping process as for prediction sample values is proposed for the reconstructed samples at the output of the sample-adaptive offset (SAO) filter in WC. The modified picture sample array saoPicture[ xS, ][ ySj ] is derived as follows: saoPicture[ xS,][ ySj] - Clip3( 0, ( 1 « BitDepth ) - 1, recPicturef xSi][ ySj J + SaoOffsetValf cldx ][ rx ][ ry ][ edgeldx]).
[0181] Clipping the samples to the bit depth range after certain processing stages assures that the reconstructed samples in the final picture will match independent of the internal bit depth used in the arithmetic operations for specific processors used in the encoder and / or the decoder.
[0182] In some implementations of video coding, a more sophisticated adaptive clipping technique Cui ef al., “NonEE : Adaptive clipping with signaled lower and upper bounds,” JVET-AF0169, October 2023, was introduced. ThisDocket No.: 24-2054PCT replaces the conventional clipping to the bit depth bounds by clipping to the real minimum and maximum luma sample values of each picture. This mechanism helps reduce distortion caused by various encoder / decoder stages (e.g. , mainly for the quantization stage), making the reconstructed values closer to the samples in the original picture and reducing the distortion (e.g., providing higher peak signal to noise ratio (PSNR)).
[0183] On the encoder side, this adaptive clipping technique scans the luma samples of the original picture and determines their actual maximum and minimum values. Thereafter, the difference between those bounds and fixed maximum and minimum values, set to the "narrow video range” maximum and minimum values, are signaled in the picture header.
[0184] FIG. 19A shows an example of the bounds employed in this adaptive clipping tool using, for example, a bit depth of 10 bits. The maximum full video range 1802 and the minimum full video range 1803 are 1023 and 0, respectively, for the bit depth of 10 bits. The maximum and minimum picture sample values will always be between 1023 and 0. For intra-coded slices, i.e., slice type I, the maximum and minimum luma bounds of the "reference range” (between max luma 1902 and min luma 1903) are set to the maximum and minimum luma bounds of the “narrow video range” (max reference range 1900 and min reference range 1901), which are 940 and 64, respectively.
[0185] The maximum delta 1904 and the minimum delta 1905 are calculated as the differences between the maximum luma of real picture 1902 and the minimum luma of real picture 1903 and luma values of the maximum reference range 1900 and the minimum reference range 1901. The actual maximum luma of real picture 1902 and the actual minimum luma of real picture 1903 can be determined by scanning the pixels of the original picture.
[0186] To reduce the signaling overhead that may occur when values of the maximum delta 1904 and the minimum delta 1905 are large, the encoder applies a quantization to the delta values, denoted as the “AdaptiveClipQuant" flag (block 1913 in FIG. 19B). For slices of type I, the quantization value is set to 2 (e.g., indicated by AdaptiveClipQuant flag equal to 1) and set to 32 (25) for other slice types (indicated by AdaptiveClipQuant flag equal to 0). In some implementations of video coding, the encoder always signals the AdaptiveClipQuantflag to indicate the delta quantization step according to the slice type.
[0187] The reference range used to compute the delta values is also adjusted according to the slice type. Slices of type I use the “narrow video range," but the other slices (e.g., slice type P, slice type B) use the maximum and minimum ranges used for the collocated slices (e.g., an adjacent slice in the previous or subsequent frames).
[0188] FIG. 19B depicts a flowchart of this adaptive clipping tool in some implementations of video coding and described in Cui eta / ., “EE2-4.1: Adaptive clipping with signalled lower and upper bounds," JVET-AG0145, January 2024. As shown in the flowchart, after initialization of the bit depth (e.g., bit depth 10) at block 1908, the slice type of the current slice is determined at block 1910. If the slice is of slice type I, then at block 1912, the maximum and minimum bounds of the reference range are set to the narrow video range (e.g., 940 and 64, respectively, for bit depth 10) and the AdaptiveClipQuant flag is set to 0. If the slice type is different from slice type I, then at block 1911, the maximum and minimum bounds of the reference range are set to the maximum and minimum values of the collocated picture range and the AdaptiveClipQuant flag is set to 1.Docket No.: 24-2054PCT
[0189] At block 1913, the AdaptiveClipQuant flag is signaled on a bitstream. At block 1914, the maximum luma of real picture 1902 and the minimum luma of real picture 1903 are determined, and at block 1915, the maximum delta 1904 is determined as the difference between the maximum luma of real picture 1902 and the maximum reference range 1900 and the minimum delta 1905 is determined as the difference between the minimum luma of real picture 1903 and the minimum reference range 1901.
[0190] The maximum delta 1904 and the minimum delta 1905 determined at block 1915 are quantized at block 1916. The quantization is performed using the quantization step determined based on the AdaptiveClipQuant flag, i.e., if AdaptiveClipQuanttlag is not set, then a quantization step of 2 is used and if AdaptiveClipQuanttlag is set, a quantization step of 25is used. Thereafter, at block 1917 and block 1918, the quantized delta maximum and the quantized delta minimum values are signaled on the bitstream. In some existing implementations of video coding, both delta values are always signaled to the decoder.
[0191] Signaling the AdaptiveClipQuanttlag and both delta values to the decoder significantly increases the bit rate for clipping, thereby reducing the encoding efficiency.
[0192] Embodiments of this disclosure provide for improved adaptive clipping with reduced bandwidth use. Embodiments of this disclosure achieve improved adaptive clipping with reduced bandwidth use by implementing several distinguishing features compared to the adaptive clipping technique that is currently being implemented in video coding. Embodiments of this disclosure do not signal the “AdaptiveClipQuant’ flag of block 1913 of the adaptive clipping technique. Instead of signaling the flag, the decoder may derive the flag from the slice type of the current slice. For example, in WC, the "sh_slice_type” parameter in the slice header may include the slice type of the current slice.
[0193] According to embodiments disclosed herein, for slice type I, the decoder sets the reference range according to the “vui_full_range_flag" parameter if it is available. If absent, the decoder assumes it is false and uses the "narrow video range" as the reference range by default. Values of maximum delta and minimum delta can be represented in the deltaMax and the deltaMin parameters, respectively. In some examples, the values of maximum delta and minimum delta can be encoded without the sign because they are always negative and positive. That is, when the reference range is the “narrow video range," deltaMin and deltaMax are negative and positive, respectively, to the reference range, and when the reference range is the “full video range,” deltaMin and deltaMax are positive and negative, respectively, to the reference range. Otherwise, deltaMin and deltaMax may need to be encoded with the sign.
[0194] Additionally, according to embodiments disclosed herein, the encoder signals to the decoder a new “range_exact_flag" to indicate if the actual picture maximum and minimum luma values match the reference range. If they match, the delta values (deltaMax and deltaMin parameters) are not transmitted. The actual picture maximum and minimum luma values can be determined by scanning original samples of the picture.
[0195] Moreover, according to embodiments disclosed herein, a determination may be made with respect to each of the delta maximum and delta minimum whether it would be more efficient to signal that as a difference between the actual picture maximum or minimum luma values and the reference range or as a difference between the actual picture maximum or minimum luma values and a secondary reference range. The encoder may then signal delta maximumDocket No.: 24-2054PCT and / or delta minimum in a more efficient manner and also associate the signaled delta maximum and / or delta minimum with respective reference range indicators identifying the reference range or the secondary reference range.
[0196] FIGS. 20 and 21 illustrate an example of obtaining a reference range of video sample values, according to some embodiments. The embodiments are illustrated for a bit-depth of 10 bits. FIG. 20 shows a scenario in which the “vuiJulljangeJIa is false, or it is not present in a bitstream, and consequently, the decoder adjusts the maximum reference range 2000 and the minimum reference range 2001 to the maximum and minimum values of the "narrow video range.” Values of the maximum luma of real picture 2004 and the minimum luma of real picture 2005 (e.g., pixels of the original picture) are determined. The maximum delta 2006 is the difference between the maximum luma of real picture 2004 and the maximum reference range 2000, and the minimum delta 2007 is the difference between the minimum luma of real picture 2005 and the minimum reference range 2001.
[0197] FIG. 21 shows a scenario in which the vui_full_range_flag is present in the bitstream and it is true, and consequently, the decoder adjusts the maximum reference range 2102 and the minimum reference range 2103 to the maximum full video range 1802 and the minimum full video range 1803. The maximum luma of real picture 2106 and the minimum luma of real picture 2107 are determined. The maximum delta 2108 is the difference between the maximum luma of real picture 2106 and the maximum bound of reference range 2102, and the minimum delta 2109 is the difference between the minimum luma of real picture 2107 and the minimum bound of the reference range 2103.
[0198] FIG. 22 shows a scenario, according to embodiments of this disclosure, in which maximum delta (deltaMax) and minimum delta (deltaMin) each may be specified in relation to a range (e.g., one of the “full video range” or the “narrow video range”) that yields a smaller difference. For example, if the difference between the range maximum of the full video range and the maximum of actual luma values is smaller than the difference between the range maximum of the narrow video range and the maximum of actual luma values, then deltaMax is set to the difference between the range maximum of the full video range and the maximum of actual luma values. This provides for more efficient signaling of the delta values to the decoder.
[0199] In the example shown in FIG. 22, the vui_full_range_flag is present in the bitstream and it is true, and consequently, the decoder adjusts the maximum and minimum bounds of the reference range to the maximum full video range 1802 and the minimum full video range 1803. The maximum luma of real picture 2206 and the minimum luma of real picture2207 are determined.
[0200] The signaled reference range, in this case a range determined by the maximum full video range 1802 and the minimum full video range 1803, is considered as the reference range (a primary reference range), and a secondary reference range is set based on the first reference range. In this example, a range determined by the maximum narrow video range 1804 and the minimum narrow video range 1805 is set as the second reference range. The maximum threshold 2202 and the minimum threshold 2204 are set based on the primary and the secondary reference ranges. The maximum threshold 2202 and the minimum threshold 2204 can be determined in one of several ways. In the illustrated embodiment, the midpoint between the maximum of the primary reference range, i.e., the maximum full video range 1802, and the maximum of the secondary reference range, i.e., the maximum narrow video range 1804, is set as the maximumDocket No.: 24-2054PCT threshold 2202, and the midpoint between the minimum of the primary reference range, i.e., the minimum full video range 1803, and the minimum of the secondary reference range, i e., the minimum narrow video range 1805, is set as the maximum threshold 2204.
[0201] The maximum luma of real picture 2206 and the minimum luma of real picture 2207 are determined. After the maximum threshold 2202 and the minimum threshold 2204 are determined, deltaMax and deltaMin can be dynamically determined in accordance with the maximum and minimum luma values and the threshold values. If the maximum luma of real picture 2206 is greater than the maximum threshold 2202, deltaMax is set to the difference between the maximum luma (value) of real picture 2206 and the maximum (value) of the full video range 1802, which in this example is the maximum of the primary reference range. Otherwise, deltaMax is set to the difference between the maximum luma (value) of real picture 2206 and the maximum narrow reference range 1804, which in this example is the maximum of the secondary reference range. If the minimum luma (value) of real picture 2207 is lower than the minimum threshold 2204 (i.e., minimum luma of real picture 2207 is between the minimum threshold 2204 and the minimum (value) of full video range 1803, deltaMin is set to the difference between the minimum luma of real picture 2207 and the minimum of full video range 1803. Otherwise (i.e., minimum luma (value) of real picture 2207 is between minimum threshold 2204 and minimum of the narrow video range 1805), deltaMin is set to the difference between the minimum luma of real picture 2207 and the minimum of the narrow reference range 1805.
[0202] FIG. 23 illustrates an example flowchart 2300 for the selective reference range determination for the luma adaptive clipping, according to embodiments of this disclosure. A process of flowchart 2300 may be performed by an encoder during or at the end of one or more of several processes during the encoding process to prevent sample value overflow and / or inversion. The process of flowchart 2300 determines difference values (delta values) between a target range for clipping and a selected reference range, and signals the difference values for signaling to the decoder.
[0203] After initializing the process of flowchart 2300 by, for example, determining the bit depth etc., quantization step size for the delta parameters and the selection of the first reference range are performed. The quantization step size for the delta parameters and the first reference range are selected according to the slice type (2302). If the slice is not of slice type I, the quantization parameter is set to a first quantization value (e.g., 32) and may optionally set an AdaptiveClipQuant configuration flag to 1 (2304), and the reference range (primary reference range) is set to the maximum and the minimum values of the collocated picture (2308).
[0204] If the slice type is type I, the quantization step size is set to a second quantization value (e.g., 2) and may optionally set the AdaptiveClipQuant configuration flag to 0 (2306). The reference range (the primary reference range) is determined based on the full video range flag (2311), which is set to a full video range of [0, 2N-1] if it is 1 (2310) or it is set to a narrow video range, for instance [64, 940] for a bit depth of 10 bits, if the full video range flag is 0 (2312). If the full video range flag is not present at the VUI, it is inferred that a narrow video range should be used. At the encoder, the full video range flag may be a configuration setting.
[0205] The encoder determines the maximum and minimum luma values by scanning the whole picture (2313). The determination of the range of actual values may be performed block by block in the picture. For example, since theDocket No.: 24-2054PCT prediction and encoding of the picture is performed on a block-by-block basis, each block is clipped (that is, the samples of each block are clipped) when necessary to prevent sample values exceeding the bit depth during the prediction and encoding of the picture.
[0206] If the maximum and minimum luma values match the reference range (2314), the “range_exact_flag" is set to 1, and the encoder signals the range_exact_flag in the bitstream (2315). Otherwise, if the maximum and minimum luma values do not match the reference range (e.g., either bound does not match), the “range_exact_flag” is set to 0 and the encoder signals the range_exact_flag in the bitstream (2316).
[0207] When the maximum and minimum actual luma values (also referred to as real maximum and real minimum) do not match the reference range (the primary reference range), the encoder evaluates if a secondary reference range for the maximum and / or minimum is more efficient for determining the delta parameters. If the slice type is type I and the reference range (primary reference range) is one of the narrow video range or the full video range, the secondary reference range can be set to the other of the narrow video range or the full video range. If the slice type is not type I, the reference range is set to the collocated reference range, and the secondary reference range is the default reference range according to the vui_full_video_range flag signaled in the VUI (or the narrow range if it is not present). The selection of the primary reference range or the secondary reference range as the more efficient may be performed individually for the maximum and minimum bounds and signaled to the decoder. The encoder determines a threshold (maximum threshold or thMax) between the primary and the secondary maximum reference ranges and a threshold (minimum threshold or thMin) between the first and second minimum reference ranges. For instance, for a 10-bit bit depth, an encoder may determine a luma value between 940 and 1023 for the thMax threshold and a luma value between 0 and 64 for the thMin threshold.
[0208] Suppose the secondary reference range's maximum value (e.g., 1023) is greater than the primary reference range's maximum value (e.g., 940), and the maximum actual luma value is greater than the maximum threshold thMax (2320). In that case, the delta maximum (deltaMax) parameter is determined using the secondary reference range (2321 ), and a reference range indicator (e.g. AdaptiveRetRangeMax flag) is set to 1 and signaled to the decoder (2322). Alternatively, if deltaMax is determined as the difference between the maximum actual luma value and the primary reference maximum value (2323), then AdaptiveRefRangeMax flag is set to 0 and signaled to the decoder (2324).
[0209] Based on similar logic, if the secondary reference range’s minimum value is lower than the primary reference range’s minimum value and the minimum actual luma value is less than the minimum threshold thMin (2327), then the delta minimum (deltaMin) parameter is determined using the secondary reference range (2328), and a reference range indicator (e.g., AdaptiveRefRangeMin flag) is set to 1 and signaled to the decoder (2329). Alternatively, if deltaMin is determined as the difference between the maximum actual luma value and the primary reference maximum value (2330), then AdaptiveRefRangeMin flag is set to 0 and signaled to the decoder (2332).
[0210] Further, the deltaMax value is quantized (2325) and signaled to the decoder (2326), and the deltaMin value is quantized (2333) and signaled to the decoder (2326). The quantizing at (2325) and (2333) is performed using the quantization step size determined at, for example, (2304) or (2306).Docket No.: 24-2054PCT
[0211] FIGS. 24A and 24B depict an example comparing the number of delta values signaled for the conventional adaptive clipping tool as described, for example, in relation to FIG. 19B, and an embodiment of the present disclosure. It can be seen that the amount of delta parameters signaled in the illustrated example embodiment in FIG. 24A is significantly lower than the amount of delta parameters signaled in the example implementation of FIG. 19B shown in FIG. 24B. The illustration is for deltaMin parameters.
[0212] FIG. 25 illustrates flowchart 2500 for a method for selective reference range determination for improved luma adaptive clipping, according to some embodiments of the present disclosure. The method of flowchart 2500 may be implemented in a coder such as an encoder (e.g ., encoder 200 of FIG. 2). Some of the steps of flowchart 2500 may not necessarily be in the same sequence, as would be understood by a skilled person in the art. FIG. 25 shows flowchart 2500 illustrating operations performed for luma samples.
[0213] A process according to the method of flowchart 2500 may be performed by the encoder during or at the end of any one or more processing stages in the prediction and encoding processes. For example, the method of flowchart 2500 can be used to clip sample values to prevent overflow and / or value inversion during or after any one or more of the stages such as prediction, adaptive loop filter (ALF), deblocking filter, SAG filter, and when the decoded residual is added to the prediction.
[0214] At block 2502, a range of actual values of original samples in a picture is determined. The range of actual values may be determined by scanning values of original pixels in the picture to determine a maximum value and a minimum value. In some embodiments, the original samples of the picture comprise samples obtained by applying a temporal filter to two or more pictures including a current picture. The range of actual values is defined by the determined maximum value and the determined minimum value. The range of actual values determined at block 2502 may also be referred to as the "target range”, or “clipping range.”
[0215] At block 2504, a first difference of a maximum of the target range is determined in relation to the maximum of a first reference range or to the maximum of a secondary reference range for reconstructed samples of the picture, and at block 2506 a second difference of a minimum of the target range is determined in relation to the minimum of the first reference range or to the minimum of the secondary reference range. The differences determined at block 2504 and block 2506 may be referred to as “delta maximum” (deltaMax) and “delta minimum” deltaMin), respectively.
[0216] In some embodiments, before determining the delta maximum and the delta minimum, the encoder determines a reference range for samples of the picture, referred to herein as the “primary reference range”, and the target range determined at block 2502 is compared to the primary reference range. The primary reference range may be established for each picture based on configuration. In some embodiments, the primary reference range is determined to be one of two video ranges: a full video range or a narrow video range. As described above, the full video range is determined as luma values between a minimum luma value of 0 to a maximum luma value of 2N- 1 , where N is the bit depth. In some examples, the narrow video range is determined as luma values between a minimum of 16*2N-8to a maximum of, for example, 235*2N-8. Other values instead of 16 and 235 may be used for the minimum and maximum of the narrow video range.Docket No.: 24-2054PCT
[0217] The encoder may obtain the bit depth value from configuration. A configuration parameter may specify a flag indicating whether the primary reference range is to be set to the full video range or to the narrow video range. For example, if the flag is set, the primary reference range is set as the full video range, or if the flag is not set, the primary reference range is set as the narrow video range. The flag is optionally signaled (transmitted) on the bitstream to the decoder. For example, in some embodiments, the flag is the vui_full_range_flag parameter in the video usability information (VUI) syntax element signaling the video range to the decoder in WC.
[0218] Thus, when the vui_full_range_flag or the corresponding configuration flag is set, indicating that the primary reference range in the full video range, the comparison is between the target range determined at block 2502 and the full video range. When the vui_full_range_flag or the corresponding configuration flag is not set, indicating that the primary reference range is the narrow video range, the comparison is between the target range determined at block 2502 and the narrow video range.
[0219] The comparing of the target range determined at block 2502 to the primary reference range can be performed by comparing the maximum value in the target range to the maximum bound of the primary reference range and by comparing the minimum value in the target range to the minimum bound of the primary reference range.
[0220] An indicator, referred to herein as a match indicator (e.g., range_exact_flag), may be set, indicating whether a target range for reconstructed samples of the picture matches the primary reference range. For example, if the maximum of the target range is equal to the maximum of the primary reference range, and a minimum of the target range is equal to the minimum of the primary reference range, then the match indicator can be set to 1 , and otherwise the match indicator is set to 0. In some embodiments, the two ranges may be considered to match if their maximums are within a threshold distance of each other and if their minimums are within a threshold distance of each other.
[0221] In some embodiments the match indicator may be a flag such as a binary flag. In some embodiments, the indicator is a "range_exact_flag" parameter included in a syntax element or other metadata in the bitstream. In some embodiments, the range_exact_flag is included in any of a sequence parameter set (SPS), a video usability information (VUI), a picture parameter set (PPS), or a supplementary enhancement information (SEI) syntax element in association with the picture.
[0222] If it is determined by the comparing that the target range equals the primary reference range, the match indicator is set to true, and the match indicator is signaled on the bitstream to the decoder. Otherwise, if it is determined that the target range is not equal to the primary reference range, the match indicator is set to false.
[0223] If it is determined that the target range does not match the primary reference range, the method of flowchart 2500 proceeds to determine the delta maximum and the delta minimum. If the target range does not match the primary reference range, the difference (delta) between the target range and one or both the primary reference range and the secondary reference range are derived in order to be transmitted to the decoder. At 2504-2506, a difference between the target range and at least one of the primary reference range or the secondary reference range is determined. More particularly, the encoder determines whether it is more efficient to signal the difference between the target range and theDocket No.: 24-2054PCT primary reference range as is, or whether it is more efficient to signal it as a difference between the target range and the secondary reference range.
[0224] In some embodiments, the secondary reference range is set based on the primary reference range. For example, if the primary reference range is the narrow video range, then the secondary reference range is set to the full video range, or if the primary reference range is the full video range, the secondary reference range is set to the narrow video range.
[0225] In some embodiments, a maximum threshold (thMax) between the maximum of the primary reference range and the maximum of the secondary reference range, and a minimum threshold thMin) between the minimum of the primary reference range and the minimum of the secondary reference range, are determined. In effect, a threshold range (i.e., a range from thMax to thMin) is determined, and is used to determine how the difference between the target range and at least one of the primary reference range and / or the secondary reference range for samples of the picture should be signaled. The maximum threshold can be determined as a midpoint (e.g., average) between the maximums of the primary and secondary reference ranges, and similarly the minimum threshold can be determined as a midpoint between the minimums of the primary and secondary reference regions. Alternatively, the maximum threshold and minimum threshold may be determined based on an efficiency measure such as, for example, on the cost in terms of the bits that are required to signal the delta parameters (delta maximum and delta minimum) using a specific encoding such as context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), and / or syntax-based context-based binary arithmetic coding (SBAC). An example of maximum threshold and minimum threshold is illustrated in FIG. 22.
[0226] The delta maximum and the delta minimum may both represent the difference between the target range and the same one of the primary or secondary reference ranges, or they may each represent a difference between the target range and a different one of the primary reference range and the secondary reference range. For example, if the maximum of the target range is greater than the maximum threshold thMax), then the delta maximum is set / obtained to be between the maximum of the target range and the greater of the maximums of the primary reference range and the secondary reference range. If the maximum of the target range is less than the maximum threshold, then the delta maximum is set / obtained to be between the maximum of the target range and the lesser of the maximums of the primary reference range and the secondary reference range.
[0227] Similarly, if the minimum of the target range is less than the minimum threshold (thMin), then the delta minimum (deltaMin) is set / obtained to be between the minimum of the target range and the lesser of the minimums of the primary reference range and the secondary reference range. If the minimum of the target range is not less than the minimum threshold, then the delta minimum is set / obtained to be between the minimum of the target range and the higher of the minimums of the primary reference range and the secondary reference range.
[0228] At block 2508, at least one indicator (e.g., AdaptiveRefRangeMax and / or AdaptiveRefRangeMin) is set indicating whether the differences (determined at blocks 2504-2506) relate to the primary reference range or to theDocket No.: 24-2054PCT secondary reference range. The indicators indicating whether the differences relate to the primary reference range or the secondary reference range may be referred to as “adaptive range use” indicators.
[0229] In some embodiments, one adaptive range use indicator (e. g. , AdaptiveRefRangeMax) is set for the difference of range maximums indicating which of the primary or the secondary reference ranges relates to the difference of range maximums, and another adaptive range use indicator (e.g., AdaptiveRefRangeMin) is set for the difference of range minimums indicating which of the primary or secondary reference ranges relates to the difference of range minimums.
[0230] In some embodiments, an adaptive range use indicator may be set (or may be set, but not transmitted) only to indicate when the selected reference range is the secondary reference range. For example, if the selected reference range is not the secondary reference range, then the encoder may not set or transmit a corresponding adaptive range use indicator (e.g., may not transmit AdaptiveRefRangeMax or AdaptiveRefRangeMin) but the decoder may interpret the range difference that is received without an associated adaptive range use indicator as being related to the primary reference range.
[0231] In some embodiments, the adaptive range use indicators) may be each a binary flag. In some embodiments, the adaptive range use indicator(s) are included in any of a sequence parameter set (SPS), video usability information (VUI), picture parameter set (PPS), or supplementary enhancement information (SEI) in association with the picture.
[0232] At block 2510, one or more adaptive range use indicators, and one or more of the delta maximum and the delta minimum are signaled on the bitstream in association with the picture.
[0233] In some embodiments, the match indicator may be transmitted on the bitstream. As noted above, the match indicator may be the range_exact_flag, and indicates to the decoder whether the target range matches the primary reference range.
[0234] The one or more adaptive range use indicators may include one or both AdaptiveRefRangeMax or AdaptiveRefRangeMin. In some embodiments, when the match indicator is set to indicate that the target range does not match the primary reference range (range_exact_flag = 0), a difference and the corresponding adaptive range use indicator AdaptiveRefRangeMax or AdaptiveRefRangeMin is signaled for each of the delta maximum (deltaMax) and delta minimum (deltaMin).
[0235] In some embodiments, when deltaMin or deltaMax is determined in relation to a predetermined one of the primary or secondary reference ranges, the deltaMax or deltaMin may be signaled without a corresponding AdaptiveRefRangeMax or AdaptiveRefRangeMin and the decoder can interpret a deltaMax or deltaMin received without an associated AdaptiveRefRangeMax or AdaptiveRefRangeMin as being determined in relation to the predetermined one of the primary or secondary reference ranges. For example, if deltaMax is determined in relation to the primary reference range and deltaMin is determined in relation to the secondary reference range, deltaMax is signaled without an associated corresponding AdaptiveRefRangeMax and deltaMin is signaled with an associated corresponding AdaptiveRefRangeMin.
[0236] In some cases, one of deltaMax or deltaMin may be 0. In such cases, some embodiments may provide for signaling only non-zero deltaMax or deltaMin values. The decoder can interpret the absence of one of deltaMax or deltaMin on the bitstream as indicating that the corresponding difference is 0.Docket No.: 24-2054PCT
[0237] The deltaMax and deltaMin may be signaled as quantized values. In example embodiments, the quantization step size may be determined in accordance with the slice type of the current slice of the picture. If the slice type is type I, the quantization step size is set to 2, and if the slice type is different than type I, the quantization step size is set to 26. The delta maximum and the delta minimum values are quantized using the quantization step size determined in accordance with the slice type.
[0238] In some embodiments, each of the indicators (e.g. , a match indicator or adaptive range use indicator(s)) is a single flag. In some other embodiments, the match indicator comprises two flags with one flag indicating the status of the comparing the maximum bound of the primary or the secondary reference range to the maximum value of the target range, and the other flag indicating the status of the comparing the minimum bound of the primary or the secondary reference range to the minimum value of the target range.
[0239] The encoder may also signal the bit depth used for determining the primary reference range etc. to the decoder. For example, in WC, the bit depth may be signaled through the sps_bitdepth_minus8 parameter in the sequence parameter set (S PS) syntax element.
[0240] The current block or group of blocks in the picture is clipped according to the target range. That is, sample values in the current block or group of blocks are clipped to ensure that they are between the minimum bound and the maximum bound of the target range. As noted above, the clipping can take place during or after one or more stages in the encoder. The samples to which clipping is applied in the encoder may be referred to as prediction samples. The clipped samples of the picture are signaled on the bitstream to the decoder.
[0241] In some implementations of video coding, the AdaptiveClipQuant lag is signaled to indicate whether adaptive quantization is enabled / used. Embodiments of the present disclosure may derive the parameter(s) associated with this flag and therefore this flag is not needed and may be omitted from being transmitted in the bitstream to the decoder. For example, the decoder may be configured to determine the quantization step size solely based on the slice type of the current slice. For example, the “sh_slice_type” parameter in the slice header may include the slice type of the current slice.
[0242] The method of flowchart 2500 is described above, for example, in which a value of 0 for an adaptive range use indicator indicates the primary reference range, and a value of 1 for the adaptive range use indicator indicates the secondary reference range. In some other alternative examples, a value of 0 indicates the currently selected reference range (e.g., based on a previous picture / block) of the primary or secondary reference ranges and a value of 1 indicates the other of the primary or secondary reference ranges.
[0243] The method of flowchart 2500 is described above, without limitation, primarily for luma samples. The same technique described with respect to flowchart 2500 may also be applied to chroma samples.
[0244] FIG. 26 illustrates flowchart 2600 for a method for selective reference range determination for improved luma adaptive clipping, according to some embodiments of the present disclosure. The method of flowchart 2600 may be performed by a decoder (e.g., decoder 300 of FIG 3). Some of the steps of flowchart 2600 may not necessarily be in the same sequence, as would be understood by a skilled person in the art.Docket No.: 24-2054PCT
[0245] A process according to the method of flowchart 2600 may be performed during or at the end of several stages in the reconstruction and decoding performed in the decoder, to ensure that the samples of reconstructed blocks do not overflow / underflow. For example, the method of flowchart 2600 can be used to clip sample values to prevent overflow and / or value inversion during or after any one or more of the stages such as reconstruction, adaptive loop filter (ALF), deblocking filter, SAG filter, and when the decoded residual is added to the prediction.
[0246] At block 2602, in some examples, the primary reference range may be set to a default range. For example, the default range may be predefined in the coder or it maybe preset for the video. In some examples, the reference range is set based on a status of an indicator of reference range in a bitstream. In some examples, based on a status of a first indicator in a bitstream, the reference range is set for reconstructed samples of a picture.
[0247] The indicator of primary reference range, also referred to as a reference range flag / indicator, may be a flag indicating whether the primary reference range is to be set to the full video range or to the narrow video range. For example, if the flag is set, the primary reference range is set equal to the full video range, or if the flag is not set, the primary reference range is set equal to the narrow video range. If the reference range indicator is absent in the bitstream, it may be considered the same as the flag not being set, and the primary reference range is set equal to the narrow video range. According to some embodiments, the reference range indicator is the vui_full_range_flag parameter in the VUI syntax element in the bitstream received from the encoder.
[0248] The video ranges, full video range and the narrow video range depend on a bit depth parameter and were described above. The decoder may obtain the bit depth from the bitstream. In some embodiments, the bit depth may be signaled by the encoder through the sps_bitdepth_minus8 parameter in the sequence parameter set (SPS) syntax element.
[0249] At block 2604, at least one indicator, referred to herein as "adaptive range use indicator(s)” , is obtained from the bitstream.
[0250] In some examples, another indicator, an indicator indicating that the primary reference range does not match a target range may be obtained from the bitstream. As already noted in relation to flowchart 2500, the indicator indicating that the reference range does not match the target range is sometimes referred to as the "match” flag / indicator.
[0251] The match indicator obtained from the bitstream indicates whether the target range for the picture is equal to the primary reference range for reconstructed sample values of the picture. The target range is the range to be used for clipping reconstructed pixels. The encoder determines the target range as described above in relation to flowchart 2500, and, when the target range is different from the reference range, signals the difference between the target range and an indicated range to the decoder.
[0252] In some embodiments, the match indicator maybe a binary flag. In some embodiments, the match indicator is a range-exact-flag included in any of a sequence parameter set (SPS), video usability information (VUI), picture parameter set (PPS), or supplementary enhancement information (SEI) in association with the picture.
[0253] When the match indicator is set (e.g., range_exact_flag = 1), it indicates that the target range is equal to the primary reference range. Thus, the decoder sets the target range as equal to the primary reference range. In someDocket No.: 24-2054PCT embodiments, when the match indicator is set, the target range is set equal to the primary reference range based only on the match indicator.
[0254] When the match indicator is not set (e.g., range_exact_flag = 0), it indicates that the target range is different from the primary reference range. When the match indicator is not set, the decoder proceeds to block 2608 to determine the target range.
[0255] The at least one adaptive range use indicators obtained from the bitstream at block 2604 indicate whether one or more differences obtained from the bitstream relate to the primary reference range or to the secondary reference range for reconstructed samples of the picture. As also noted in relation to flowchart 2500, the indicator(s) indicating whether the difference is specified in relation to the primary reference range or in relation to the secondary reference range for reconstructed samples of the picture may be referred to as an "adaptive range use’’ indicator / flag.
[0256] In an example, the bitstream includes two adaptive range use indicators, one in association with the delta maximum (AdaptiveRefRangeMax) and another one in association with the delta minimum (AdaptiveRefRangeMin). When the delta maximum or delta minimum is derived in relation to the secondary reference range, the associated adaptive range use indicator is set, and when the delta maximum or delta minimum is derived in relation to the primary reference range, the associated adaptive range use indicator is not set.
[0257] The encoders signaling of the adaptive range use indicators is described above in relation to blocks 2504- 2508 of flowchart 2500.
[0258] At block 2606, one or more differences between the target range and the primary reference range and / or secondary reference range is obtained from the bitstream. In some examples, the difference between the maximum of the target range and the maximum of the primary or and / or secondary reference range (referred to as delta maximum or deltaMax), and the difference between the minimum of the target range and the minimum of the primary or and / or secondary reference range are obtained from the bitstream (referred to as delta minimum or deltaMin).
[0259] At block 2608, the target range is derived using the delta maximum and delta minimum obtained at block 2606 and using the adaptive range use indicator(s) obtained at block 2604.
[0260] In some examples, the delta maximum deltaMax) and delta minimum (deltaMin) obtained at block 2606 are associated with respective adaptive range use indicators obtained at block 2604. For example, the delta maximum is associated with the AdaptiveRefRangeMax and the delta minimum is associated with the AdaptiveRefRangeMin. If the AdaptiveRefRangeMa flag is set, the decoder interprets that the delta maximum is specified in relation to the secondary reference range, and if the AdaptiveRefRangeMax flag is not set, the decoder interprets that the delta maximum is specified in relation to the primary reference range. Similarly, if the AdaptiveRefRangeMin flag is set, the decoder interprets that the delta minimum is specified in relation to the secondary reference range, and if the AdaptiveRefRangeMin flag is not set, the decoder interprets that the delta minimum is specified in relation to the primary reference range.Docket No.: 24-2054PCT
[0261] Then, based on the differences (delta maximum and / or delta minimum) obtained at block 2606 and the determination as to which of the primary and / or secondary reference ranges is used as the basis for the delta maximum and the delta minimum, the range of actual luma values, that is, the target range, is derived.
[0262] In some examples, the difference values are received as quantized difference values, and would require to be dequantized. The quantization step size used by the encoder to quantize the delta maximum and delta minimum values can be determined based on the slice type of the current slice. In an example, if the slice type is slice type I, then the quantization step size is determined to be 2 and if the slice type is not slice type I, the quantization step size is determined to be 25. The decoder dequantizes each of delta maximum and delta minimum using the determined quantization step size. In an example, the “sh_slice_type" parameter in the slice header may include the slice type of the current slice.
[0263] At block 2610, reconstructed samples of the picture are clipped to be in the target range. Each of the samples of the reconstructed current block is clipped to have a luma value between the maximum and minimum bounds of the target range.
[0264] The clipping of the reconstructed samples in accordance with the derived target range may be performed, for example and without limitation, in an inverse quantization, a post-processing filter, in a weighted samples prediction for a geometric partitioning mode, and / or at an output of a sample-adaptive offset (SAG) filter.
[0265] At block 2612, the picture comprising the clipped reconstructed samples is reconstructed.
[0266] The processes of flowcharts 2500 and 2600 are described above, without limitation, in relation to the full video range and narrow video range as primary and secondary reference ranges. The same techniques are applicable to pairs of other ranges known to both the encoder and decoder.
[0267] The processes of flowcharts 2500 and 2600 are described above, without limitation, primarily for luma samples. The same technique applied to chroma samples.
[0268] Embodiments of the present disclosure may be implemented in hardware using analog and / or digital circuits, in software, through the execution of instructions by one or more general purpose or special-purpose processors, or as a combination of hardware and software. Consequently, embodiments of the disclosure may be implemented in the environment of a computer system or other processing system. An example of such computer system 2700 is shown in FIG. 27. Blocks depicted in the figures above, such as the blocks in FIGS. 1, 2, and 3, may execute on one or more computer systems 2700. Furthermore, each of the steps of the flowcharts depicted in this disclosure may be implemented on one or more computer systems 2700.
[0269] Computer system 2700 includes one or more processors, such as processor 2704. Processor 2704 may be, for example, a special purpose processor, general purpose processor, microprocessor, or digital signal processor. Processor 2704 may be connected to a communication infrastructure 2702 (for example, a bus or network). Computer system 2700 may also include a main memory 2706, such as random-access memory (RAM), and may also include a secondary memory 2708.
[0270] Secondary memory 2708 may include, for example, a hard disk drive 2710 and / or a removable storage drive 2712, representing a magnetic tape drive, an optical disk drive, or the like. Removable storage drive 2712 may read fromDocket No.: 24-2054PCT and / or write to a removable storage unit 2716 in a well-known manner. Removable storage unit 2716 represents a magnetic tape, optical disk, or the like, which is read by and written to by removable storage drive 2712. As will be appreciated by persons skilled in the relevant art(s), removable storage unit 2716 includes a computer usable storage medium having stored therein computer software and / or data.
[0271] In alternative implementations, secondary memory 2708 may include other similar means for allowing computer programs or other instructions to be loaded into computer system 2700. Such means may include, for example, a removable storage unit 2718 and an interface 2714. Examples of such means may include a program cartridge and cartridge interface (such as that found in video game devices), a removable memory chip (such as an EPROM or PROM) and associated socket, a thumb drive and USB port, and other removable storage units 2718 and interfaces 2714 which allow software and data to be transferred from removable storage unit 2718 to computer system 2700.
[0272] Computer system 2700 may also include a communications interface 2720. Communications interface 2720 allows software and data to be transferred between computer system 2700 and external devices. Examples of communications interface 2720 may include a modem, a network interface (such as an Ethernet card), a communications port, etc... Software and data transferred via communications interface 2720 are in the form of signals which may be electronic, electromagnetic, optical, or other signals capable of being received by communications interface 2720. These signals are provided to communications interface 2720 via a communications path 2722. Communications path 2722 carries signals and may be implemented using wire or cable, fiber optics, a phone line, a cellular phone link, an RF link, and other communications channels.
[0273] 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 2716 and 2718 or a hard disk installed in hard disk drive 2710. These computer program products are means for providing software to computer system 2700. Computer programs (also called computer control logic) may be stored in main memory 2706 and / or secondary memory 2708. Computer programs may also be received via communications interface 2720. Such computer programs, when executed, enable the computer system 2700 to implement the present disclosure as discussed herein. In particular, the computer programs, when executed, enable processor 2704 to implement the processes of the present disclosure, such as any of the methods described herein. Accordingly, such computer programs represent controllers of the computer system 2700.
[0274] In another embodiment, features of the disclosure may be implemented in hardware using, for example, hardware components such as application-specific integrated circuits (ASICs) and gate arrays. Implementation of a hardware state machine to perform the functions described herein will also be apparent to persons skilled in the art.
Claims
Docket No.: 24-2054PCTCLAIMSWhat is claimed is:
1. A method, comprising: determining a range of actual values of original samples in a picture; comparing the range of actual values to a first reference range for the samples of the picture; setting, based on the comparing, a second indicator indicating whether a target range for reconstructed samples of the picture matches the first reference range; based on the target range not matching the first reference range: determining a first difference between the range of actual values and at least one of the first reference range or a second reference range for samples of the picture; and setting at least one first indicator indicating whether the first difference relates to the first reference range or to the second reference range; and signaling, in a bitstream, the second indicator, the at least one first indicator, and the first difference in association with the picture.
2. A method, comprising: setting, based on a status of a third indicator in a bitstream, a first reference range for reconstructed samples of a picture; obtaining, from the bitstream, a second indicator indicating that the first reference range does not match a target range; obtaining, from the bitstream and based on the second indicator indicating the first reference range does not match the target range, at least one first indicator indicating whether a first difference is specified in relation to the first reference range or in relation to a second reference range for the reconstructed samples of the picture; obtaining the first difference from the bitstream; deriving, using the first difference and based on the at least one first indicator, the target range; clipping the reconstructed samples of the picture to be in the target range; and reconstructing the picture comprising the clipped reconstructed samples.
3. A method, comprising: setting a first reference range for reconstructed samples of a picture; determining a range of actual values of original samples in a picture; determining a first difference in relation to the maximum of a first reference range or to the maximum of a second reference range for reconstructed samples of the picture; determining a second difference in relation to the minimum of the first reference range or to the minimum of the second reference range;Docket No.: 24-2054PCT setting at least one first indicator each indicating whether the first difference relates to the first reference range or to the second reference range or whether the second difference relates to the first reference range or to the second reference range; and signaling, in a bitstream, the at least one third indicator, the first difference, and the second difference in association with the picture.
4. A method, comprising: setting a first reference range for reconstructed samples of a picture; obtaining, from a bitstream, at least one first indicator indicating whether: a first difference is in relation to the maximum of the first reference range or to the maximum of a second reference range for the reconstructed samples of the picture; and a second difference is in relation to the minimum of the first reference range or to the minimum of the second reference range; obtaining the first difference and the second difference from the bitstream; deriving, using the first and second differences and based on the at least one first indicator, a target range; and clipping the reconstructed samples of the picture to be in the target range.
5. The method of any one of claim 1-4, wherein the at least one first indicator comprises one indication indicating whether: the first difference is in relation to the maximum of the first reference range and the second difference is in relation to the minimum of the first reference range for the reconstructed samples of the picture; or the first difference is in relation to the maximum of the second reference range and the second difference is in relation to the minimum of the second reference range for the reconstructed samples of the picture.
6. The method of any one of claims 1-5, wherein the at least one first indicator comprises: a first reference indicator indicating whether the first difference is in relation to the maximum of the first reference range or to the maximum of the second reference range; and a second reference indicator indicating whether the second difference is in relation to the minimum of the first reference range or to the minimum of the second reference range.
7. The method of any one of claims 2, or 4-6, wherein the setting the first reference range comprises: setting the first reference range to a first video range of a bit depth if the third indicator comprises a first value, or setting the reference range to a second video range of the bit depth if the third indicator comprises a second value; or if the third indicator is not detected from a parameter set obtained from the bitstream for the picture, setting the first reference range to the second video range if a type of a current slice in the picture is a first type or setting the first reference range to the first video range or the second video range in accordance with a collocated picture if the type of the current slice is not the first type.Docket No.: 24-2054PCT8. The method of any one of claims 2, 4, 5, or 7, wherein the at least one first indicator comprises: a first reference indicator indicating whether the first difference is in relation to the maximum of the first reference range or to the maximum of the second reference range; and a second reference indicator indicating whether the second difference is in relation to the minimum of the first reference range or to the minimum of the second reference range.
9. The method of any one of claims 1 , 3, or 5-8, wherein the determining the first difference in relation to the maximum of the first reference range or to the maximum of the second reference range comprises comparing the maximum of the range of actual values to a threshold between the maximum of the first reference range and the maximum of the second reference range.
10. The method of claim 9, wherein the threshold between the maximum of the first reference range and the maximum of the second reference range is calculated based on the first reference range and the second reference range.
11. The method of claim 9, wherein the threshold between the maximum of the first reference range and the maximum of the second reference range is calculated based on a coding efficiency of the first difference.
12. The method of any one of claims 1, 3, or 5-11 , wherein the signaling the first difference in the bitstream comprises: quantizing the first difference; and signaling the quantized first difference in the bitstream.
13. The method of claim 12, wherein the quantizing is based on a quantization step determined according to a type of a current slice of the picture.
14. The method of any one of claims 1, 3, or 5-13, wherein the first difference is included In a header of the picture in the bitstream.
15. The method of any one of claims 1, 3, or 5-14, wherein the first difference comprises a range maximum first difference and a range minimum first difference, wherein the at least one first indicator comprises only one of a first reference indicator indicating that the range maximum first difference relates to one of the first reference range or the second reference range, or a second reference indicator indicating that the range minimum first difference relates to the other of the first reference range or the second reference range.
16. The method of any one of claims 1, 3, or 5-14, wherein the first difference comprises a range maximum first difference and a range minimum first difference, wherein the at least one first indicator indicates that the range maximum first difference relates to one of the first reference range or the second reference range and that the range minimum first difference relates to the one of the first reference range or the second reference range.
17. The method of any one of claims 1 , 3, or 5-16, wherein each of the reconstructed samples comprises a luma value of a pixel.
18. The method of any one of claims 1, 3, or 5-16, wherein each of the reconstructed samples comprises a chroma value of a pixel.Docket No.: 24-2054PCT19. The method of any one of claims 3 or 5-18, wherein the determining the second difference in relation to the minimum of the first reference range or to the minimum of the second reference range comprises comparing the minimum of the range of actual values to a threshold between the minimum of the first reference range and the minimum of the second reference range.
20. The method of claim 19, wherein the threshold between the minimum of the first reference range and the minimum of the second reference range is calculated based on the first reference range and the second reference range.
21. The method of any one of claims 4 or 5, further comprising: obtaining, from the bitstream, a second indicator indicating that the first reference range does not match the target range.
22. The method of claim 21 , wherein the obtaining the at least one first indicator comprises detecting, based on a value of the second indicator, the at least one first indicator in the bitstream.
23. The method of claim 22, wherein detecting, based on the value of the second indicator, the at least one first indicator in the bitstream comprises detecting the at least one first indicator when the second indicator indicates that the first reference range does not match the target range.
24. The method of any one of claims 2, 4, 5, or 21-23, wherein each of the reconstructed samples comprises a luma value of a pixel.
25. The method of any one of claims 2, 4-5, or 21-24, wherein each of the reconstructed samples comprises a chroma value of a pixel.
26. The method of any one of claims 2, 4-5, or 21-25, wherein the clipping the reconstructed samples in the picture in accordance with the derived target range comprises applying the clipping in an inverse quantization and a post-processing filter.
27. The method of any one of claims 2, 4-5, or 21-26, wherein the clipping the reconstructed samples in the picture in accordance with the derived target range comprises applying the clipping to the reconstructed samples in a weighted samples prediction for a geometric partitioning mode.
28. The method of any one of claims 2, 4-5, or 21-27, wherein the clipping the reconstructed samples in the picture in accordance with the derived target range comprises applying the clipping to the reconstructed samples at an output of a sample-adaptive offset (SAO) filter.
29. The method of any one of claims 2, 4-5, or 21-28, wherein the first difference comprises one or both of a range maximum first difference and a range minimum first difference obtained from the bitstream.
30. The method of claim 29, wherein the at least one first indicator comprises a first reference indicator indicating that the range maximum first difference is specified in relation to one of the first reference range or the second reference range, and a second reference indicator indicating that the range minimum first difference is specified in relation to the other one of the first reference range or the second reference range.Docket No.: 24-2054PCT31. The method of claim 30, wherein the at least one first indicator comprises a first reference indicator indicating that the range maximum first difference is specified in relation to one of the first reference range or the second reference range, and a second reference indicator indicating that the range minimum first difference is specified in relation to the one of the first reference range or the second reference range.
32. The method of any one of claims 2, 4-5, or 21-31, wherein: when the at least one first indicator indicates that the first difference is in relation to the first reference range, the deriving is further based on the first reference range; and when the at least one first indicator indicates that the first difference is in relation to the second reference range, the deriving is further based on the second reference range.
33. The method of any one of claims 2, 4-5, or 21-32, wherein the first difference comprises one or both of a range maximum first difference and a range minimum first difference obtained from the bitstream.
34. The method of any one of claims 1-33, wherein the first reference range is within the second reference range.
35. The method of any one of claims 1-33, wherein the second reference range is within the first reference range.
36. The method of any one of claims 1-35, wherein the at least one first indicator is included in any of a sequence parameter set (SPS) syntax element, video usability information (VUI) syntax element, picture parameter set (PPS) syntax element, or supplementary enhancement information (SEI) syntax element in association with the picture.
37. The method of any one of claims 1-36, wherein the first reference range is set to one of a first video range and a second video range, and the second reference range is set to the other of the first video range and the second video range.
38. The method of any one of claims 1-37, wherein the at least one first indicator is a binary flag.
39. The method of any one of claims 1-38, wherein the at least one first indicator comprises a first binary flag and a second binary flag.
40. A non-transitory computer-readable medium comprising instructions that, when executed by one or more processors of an apparatus, cause the apparatus to perform the method of any one of claims 1-39.
41. An encoder comprising: one or more processors; and memory storing instructions that, when executed by the one or more processors, cause the encoder to perform the method of any one of claims 1 , 3, 5-20, or 34-39.
42. A non-transitory computer-readable recording medium storing a bitstream generated by the method for encoding a video according to any one of claims 1, 3, 5-20, or 34-39.
43. A decoder comprising: one or more processors; and memory storing instructions that, when executed by the one or more processors, cause the decoder to perform the method of any one of claims 2, 4-5, or 21-39.Docket No.: 24-2054PCT44. A non-transitory computer readable medium storing a bitstream, which, when decoded by a decoder, causes the decoder to perform the method according to any one of claims 2, 4-5, or 21-39.
45. A bitstream generated according to any one of claims 1 , 3, 5-20, or 34-39.