Symbol prediction for block-based video coding

By combining the primary transform and the secondary transform to generate transform coefficients, selecting candidate transform coefficients based on high amplitude and boundary correlation, and applying an improved cost function for symbol prediction, the problem of low symbol prediction efficiency in existing video encoding and decoding is solved, improving encoding and decoding efficiency and hardware implementation friendliness.

CN118556402APending Publication Date: 2024-08-27BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202380017546.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-12-16
Filing Date
2023-01-17
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies suffer from inefficiency and hardware implementation complexity in symbol prediction. In particular, in encoding and decoding with transform coefficients after a quadratic transform, symbol prediction fails to fully utilize the correlation between transform blocks and adjacent blocks, resulting in poor encoding and decoding efficiency.

Method used

By combining the primary transform and the secondary transform (such as LFNST) to generate transform coefficients, selecting candidate transform coefficients with high magnitude and boundary correlation, and applying a template-based hypothesis generation scheme and an improved cost function, symbol prediction is performed, thereby improving the accuracy and efficiency of symbol prediction.

Benefits of technology

It improves the encoding and decoding efficiency of transform blocks, reduces the signaling overhead of symbol prediction, enhances the friendliness of hardware codecs, and improves the overall performance of video encoding and decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118556402A_ABST
    Figure CN118556402A_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a video decoding apparatus and method for transform coefficient symbol prediction on a video decoder side. The method may include receiving a bitstream including encoded data of transform coefficients from a transform block of a video frame of a video. The method may also include determining, by a decoder, a plurality of regions in the transform block, wherein the plurality of regions includes a symbol prediction region for performing the symbol prediction and at least one other region. The method may also include parsing, by the decoder, the bitstream to obtain symbols of transform coefficients associated with the plurality of regions of the transform block according to a region-based order for signaling symbols of transform coefficients associated with the plurality of regions of the transform block. The method may also include estimating, by the decoder, an original symbol for a set of candidate transform coefficients associated with the symbol prediction region of the transform block; and updating transform coefficients associated with the symbol prediction region based on the estimated original symbols.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on and claims the priority of U.S. Provisional Application No. 63 / 300,187 filed on January 17, 2022. This application is also based on and claims the priority of PCT Application No. PCT / US22 / 53150 filed on December 16, 2022, which claims the priority of U.S. Provisional Application No. 63 / 290,307 filed on December 16, 2021. This application is also based on and claims the priority of PCT Application No. PCT / US22 / 49264 filed on November 8, 2022, which claims the priority of U.S. Provisional Application No. 63 / 277,705 filed on November 10, 2021. This application is also based on and claims the priority of PCT application No. PCT / US22 / 43607 filed on September 15, 2022, which further claims the priority of U.S. Provisional Application No. 63 / 244,317 filed on September 15, 2021 and U.S. Provisional Application No. 63 / 250,797 filed on September 30, 2021. This application is also based on and claims the priority of PCT application No. PCT / US22 / 40442 filed on August 16, 2022, which further claims the priority of U.S. Provisional Application No. 63 / 233,940 filed on August 17, 2021. The contents of all the above applications are incorporated herein by reference in their entirety. Technical Field

[0003] The present application relates to video coding and compression. More specifically, the present application relates to a video processing system and method for symbol prediction in block-based video coding. Background Art

[0004] Digital video is supported by various electronic devices, such as digital televisions, laptop or desktop computers, tablet computers, digital cameras, digital recording devices, digital media players, video game consoles, smart phones, video teleconferencing devices, video streaming devices, etc. Electronic devices send and receive or otherwise communicate digital video data across a communication network, and / or store digital video data on a storage device. Due to the limited bandwidth capacity of the communication network and the limited storage resources of the storage device, video codecs can be used to compress video data according to one or more video codec standards before communicating or storing video data. For example, video codec standards include Versatile Video Coding (VVC), Joint Exploration test Model (JEM), High-Efficiency Video Coding (HEVC / H.265), Advanced Video Coding (AVC / H.264), Moving Picture Expert Group (MPEG) codecs, etc. Video codecs typically use prediction methods that exploit the redundancy inherent in video data (eg, inter-frame prediction, intra-frame prediction, etc.) Video codecs aim to compress video data into a form that uses a lower bit rate while avoiding or minimizing degradation of video quality. Summary of the invention

[0005] An embodiment of the present disclosure provides a video decoding method for sign prediction of transform coefficients. The method may include receiving a bitstream, the bitstream including encoded data of transform coefficients of a transform block of a video frame from a video. The method may also include determining, by a decoder, a plurality of regions in the transform block, wherein the plurality of regions include a symbol prediction region and at least one other region for performing the symbol prediction. The method may also include parsing the bitstream by the decoder to obtain the sign of the transform coefficient according to a region-based order for signaling the signs of the transform coefficients associated with the plurality of regions of the transform block. The method may also include estimating, by the decoder, original symbols for a set of candidate transform coefficients associated with the symbol prediction region of the transform block; and updating the transform coefficients associated with the symbol prediction region based on the estimated original symbols.

[0006] The embodiments of the present disclosure further provide a video decoding device. The video decoding device may include a memory configured to execute the video decoding method for sign prediction of transform coefficients as described above.

[0007] The embodiments of the present disclosure also provide a non-transitory computer-readable storage medium, in which instructions are stored, and when the instructions are executed by a processor, the processor performs the video decoding method for sign prediction of transform coefficients as described above. The embodiments of the present disclosure also provide a non-transitory computer-readable storage medium, in which a bit stream is stored, and the bit stream includes encoded data of transform coefficients of a transform block. The bit stream can be decoded by the video decoding method for sign prediction of transform coefficients as described above.

[0008] Embodiments of the present disclosure also provide a video encoding method for sign prediction of transform coefficients. The video encoding method may include generating, by an encoder, transform coefficients of a transform block of a video frame from a video. The method may also include determining, by the encoder, a plurality of regions in the transform block, wherein the plurality of regions include a symbol prediction region for performing the symbol prediction and at least one other region. The method may also include predicting, by the encoder, a sign for a set of candidate transform coefficients associated with the symbol prediction region of the transform block; and generating, by the encoder, a bitstream to signal the signs of the transform coefficients associated with the plurality of regions of the transform block according to a region-based order.

[0009] The embodiments of the present disclosure further provide a video encoding device. The video decoding device may include a memory configured to execute the video encoding method for sign prediction of transform coefficients as described above.

[0010] The embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing instructions, which, when executed by a processor, causes the processor to perform the video encoding method for sign prediction of transform coefficients as described above. The embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing a bit stream generated by the video encoding method for sign prediction of transform coefficients as described above.

[0011] It is to be understood that both the foregoing general description and the following detailed description are exemplary only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate examples consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0013] Figure 1 is a block diagram illustrating an exemplary system for encoding and decoding video blocks according to some embodiments of the present disclosure.

[0014] Figure 2 is a block diagram illustrating an exemplary video encoder according to some embodiments of the present disclosure.

[0015] Figure 3 is a block diagram illustrating an exemplary video decoder according to some embodiments of the present disclosure.

[0016] FIG. 4A to FIG. 4E is a graphical representation showing how a frame may be recursively divided into multiple video blocks of different sizes and shapes according to some embodiments of the present disclosure.

[0017] Figure 5 is a graphical representation showing a top-left scan order of transform coefficients in a coefficient group according to some examples.

[0018] Figure 6 is a graphical representation illustrating a low frequency non-separable transform (LFNST) process according to some examples.

[0019] Figure 7 is a graphical representation showing the upper left region of the main transform coefficients input to a positive LFNST according to some examples.

[0020] Figure 8 is a graphical representation showing a search area for intra template matching according to some examples.

[0021] Fig. 9 is a graphical representation showing an exemplary process of symbol prediction according to some examples.

[0022] Fig.10 is a graphical representation showing the computation of a cost function for symbol prediction according to some examples.

[0023] Fig.11 is a graphical representation showing two exemplary scalar quantizers used in dependent scalar quantization according to some examples.

[0024] Fig. 12A is a graphical representation showing state transitions using a state machine having four states for dependent scalar quantization according to some examples.

[0025] Fig. 12B is to show the basis according to some examples Fig. 12A Table of exemplary quantizer selections for state transitions.

[0026] Fig.13 is a block diagram illustrating an exemplary symbol prediction process in block-based video coding according to some embodiments of the present disclosure.

[0027] Fig.14 is a graphical representation showing exemplary hypothesis generation based on linear combinations of templates according to some embodiments of the present disclosure.

[0028] Fig.15Ais a graphical representation showing an exemplary implementation of an existing symbol prediction scheme according to some examples.

[0029] Fig. 15B is a graphical representation illustrating an exemplary implementation of a vector-based symbol prediction scheme according to some implementations of the present disclosure.

[0030] Fig.16A is a graphical representation showing an exemplary calculation of a left diagonal cost function along the left diagonal direction according to some embodiments of the present disclosure.

[0031] Fig. 16B is a graphical representation showing an exemplary calculation of a right diagonal cost function along the right diagonal direction according to some embodiments of the present disclosure.

[0032] Fig.17 is a flowchart of a method for capturing dominant gradient directions within neighboring reconstructed samples of a current block according to some embodiments of the present disclosure.

[0033] Fig.18A is a graphical representation showing exemplary template samples and gradient filter windows in gradient-based selection of sample derivation directions for a cost function according to some embodiments of the present disclosure.

[0034] Fig.18B is a graphical representation showing an exemplary Histogram of Gradients (HoG) in gradient-based selection of sample-derived directions for a cost function according to some embodiments of the present disclosure.

[0035] Fig.19 is a graphical representation showing a sign prediction region for predicting the sign of a transform coefficient according to some examples.

[0036] Fig. 20 is a graphical representation showing a partitioning of a transform block according to some examples, which is used to implement an exemplary order for signaling signs of transform coefficients from an encoder to a decoder.

[0037] Fig.21 is a graphical representation showing various scanning orders for scanning signs of transform coefficients according to some examples.

[0038] Fig. 22 is a diagram showing some examples of Fig. 20 Graphical representation of implementations of different scanning orders for partitioned transform blocks.

[0039] Fig.23 is a graphical representation showing a partitioning of a transform block according to some examples, which is used to implement another exemplary order of signaling signs of transform coefficients from an encoder to a decoder.

[0040] Fig.24 is a diagram showing some examples of Fig. 20 Graphical representation of implementations of different scanning orders for partitioned transform blocks.

[0041] Fig.25A is a graphical representation showing exemplary context modeling for transform coefficient sign prediction according to some embodiments of the present disclosure.

[0042] Fig.25B is a graphical representation illustrating another exemplary context modeling for transform coefficient sign prediction according to some embodiments of the present disclosure.

[0043] Fig.26 is a flowchart of an exemplary method for symbol prediction in block-based video coding according to some embodiments of the present disclosure.

[0044] Fig. 27 is a flowchart of an exemplary video encoding method for transform coefficient sign prediction performed by a video encoder according to some embodiments of the present disclosure.

[0045] Fig.28 is a flowchart of an exemplary video decoding method for transform coefficient sign prediction performed by a video decoder according to some embodiments of the present disclosure.

[0046] Fig.29 is a block diagram illustrating a computing environment coupled to a user interface according to some implementations of the present disclosure. DETAILED DESCRIPTION

[0047] Reference will now be made in detail to specific embodiments, examples of which are shown in the accompanying drawings. In the following detailed description, numerous non-limiting specific details are set forth to aid in understanding the subject matter presented herein. However, it will be apparent to one of ordinary skill in the art that various alternatives may be used without departing from the scope of the claims, and that the subject matter may be practiced without these specific details. For example, it will be apparent to one of ordinary skill in the art that the subject matter presented herein may be implemented on many types of electronic devices having digital video capabilities.

[0048] It should be noted that the terms "first", "second", etc. used in the specification, claims, and drawings of the present disclosure are used to distinguish objects rather than to describe any particular order or sequence. It should be understood that the terms used in this manner can be interchanged under appropriate conditions, so that the embodiments of the present disclosure described herein can be implemented in an order other than those shown in the drawings or described in the present disclosure.

[0049] Figure 1is a block diagram illustrating an exemplary system 10 for encoding and decoding video blocks in parallel according to some embodiments of the present disclosure. Figure 1 As shown in , system 10 includes a source device 12 that generates and encodes video data to be later decoded by a destination device 14. Source device 12 and destination device 14 may include any of a wide variety of electronic devices, including desktop or laptop computers, tablet computers, smart phones, set-top boxes, digital televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, etc. In some implementations, source device 12 and destination device 14 are equipped with wireless communication capabilities.

[0050] In some embodiments, the target device 14 may receive the encoded video data to be decoded via the link 16. The link 16 may include any type of communication medium or device capable of moving the encoded video data from the source device 12 to the target device 14. In one example, the link 16 may include a communication medium that enables the source device 12 to send the encoded video data directly to the target device 14 in real time. The encoded video data may be modulated according to a communication standard (such as a wireless communication protocol) and sent to the target device 14. The communication medium may include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form a portion of a packet-based network (e.g., a local area network, a wide area network, or a global network such as the Internet). The communication medium may include a router, a switch, a base station, or any other device that may be useful in facilitating communication from the source device 12 to the target device 14.

[0051] In some other embodiments, the encoded video data may be sent from the output interface 22 to the storage device 32. Subsequently, the encoded video data in the storage device 32 may be accessed by the target device 14 via the input interface 28. The storage device 32 may include any of a variety of distributed or locally accessed data storage media, such as a hard drive, a Blu-ray disc, a digital versatile disk (DVD), a compact disc read-only memory (CD-ROM), a flash memory, a volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data. In another example, the storage device 32 may correspond to a file server or another intermediate storage device that can store the encoded video data generated by the source device 12. The target device 14 can access the stored video data from the storage device 2 via streaming or downloading. The file server can be any type of computer capable of storing encoded video data and sending the encoded video data to the target device 14. Exemplary file servers include a web server (e.g., for a website), a File Transfer Protocol (FTP) server, a Network Attached Storage (NAS) device, or a local disk drive. The target device 14 may access the encoded video data through any standard data connection suitable for accessing the encoded video data stored on the file server, including a wireless channel (e.g., a Wireless Fidelity (Wi-Fi) connection), a wired connection (e.g., a Digital Subscriber Line (DSL), a cable modem, etc.), or any combination thereof. The transmission of the encoded video data from the storage device 32 may be a streaming transmission, a download transmission, or a combination of both streaming and download transmissions.

[0052] like Figure 1 As shown in , source device 12 includes video source 18, video encoder 20 and output interface 22. Video source 18 may include sources such as or a combination of such sources: a video capture device (e.g., a camera), a video archive containing previously captured video, a video feed interface for receiving video data from a video content provider, and / or a computer graphics system for generating computer graphics data as source video. As an example, if video source 18 is a camera of a security monitoring system, source device 12 and target device 14 may include a camera phone or a video phone. However, the embodiments described in the present disclosure may be generally applicable to video encoding and decoding, and may be applied to wireless and / or wired applications.

[0053] The captured, pre-captured, or computer-generated video may be encoded by the video encoder 20. The encoded video data may be sent directly to the target device 14 via the output interface 22 of the source device 12. The encoded video data may also (or alternatively) be stored on a storage device 32 for later access by the target device 14 or other devices for decoding and / or playback. The output interface 22 may also include a modem and / or a transmitter.

[0054] Target device 14 includes input interface 28, video decoder 30, and display device 34. Input interface 28 may include a receiver and / or a modem and receives encoded video data via link 16. The encoded video data communicated via link 16 or provided on storage device 32 may include various syntax elements generated by video encoder 20 for use by video decoder 30 in decoding the video data. Such syntax elements may be included in the encoded video data sent over a communication medium, stored on a storage medium, or stored on a file server.

[0055] In some embodiments, the target device 14 may include a display device 34, which may be an integrated display device and an external display device configured to communicate with the target device 14. The display device 34 displays the decoded video data to a user and may include any of a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.

[0056] The video encoder 20 and the video decoder 30 may operate according to a proprietary standard or an industry standard (e.g., VVC, HEVC, MPEG-4, Part 10, AVC) or an extension of such a standard. It should be understood that the present disclosure is not limited to a specific video encoding / decoding standard and may be applicable to other video encoding / decoding standards. It is generally believed that the video encoder 20 of the source device 12 may be configured to encode video data according to any of these current standards or future standards. Similarly, it is also generally believed that the video decoder 30 of the target device 14 may be configured to decode video data according to any of these current standards or future standards.

[0057] The video encoder 20 and the video decoder 30 may be implemented as any of a variety of suitable encoder and / or decoder circuits, respectively, such as one or more microprocessors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA), discrete logic, software, hardware, firmware, or any combination thereof. When partially implemented in software, the electronic device may store instructions for the software in a suitable non-volatile computer-readable medium, and use one or more processors to execute the instructions in the hardware to perform the video encoding / decoding operations disclosed in the present disclosure. Each of the video encoder 20 and the video decoder 30 may be included in one or more encoders or decoders, and either of the encoders or decoders may be integrated as part of a combined encoder / decoder (CODEC) in the corresponding device.

[0058] Figure 2 is a block diagram illustrating an exemplary video encoder 20 according to some embodiments described in the present application. The video encoder 20 may perform intra-frame prediction encoding and inter-frame prediction encoding of video blocks within a video frame. Intra-frame prediction encoding relies on spatial prediction to reduce or remove spatial redundancy in video data within a given video frame or picture. Inter-frame prediction encoding relies on temporal prediction to reduce or remove temporal redundancy in video data within adjacent video frames or pictures of a video sequence. It should be noted that the term "frame" may be used as a synonym for the term "image" or "picture" in the field of video coding and decoding.

[0059] like Figure 2As shown in , the video encoder 20 includes a video data memory 40, a prediction processing unit 41, a decoded picture buffer (Decoded Picture Buffer, DPB) 64, an adder 50, a transform processing unit 52, a quantization unit 54 and an entropy coding unit 56. The prediction processing unit 41 also includes a motion estimation unit 42, a motion compensation unit 44, a partition unit 45, an intra-frame prediction processing unit 46 and an intra-frame block copy (Block Copy, BC) unit 48. In some embodiments, the video encoder 20 also includes an inverse quantization unit 58, an inverse transform processing unit 60 and an adder 62 for video block reconstruction. A loop filter 63 (such as a deblocking filter) may be located between the adder 62 and the DPB 64 to filter the block boundary to remove block artifacts from the reconstructed video data. In addition to using a deblocking filter, another loop filter (such as a SAO filter and / or an adaptive loop filter (Adaptive in-Loop Filter, ALF)) may be used to filter the output of the adder 62. In some examples, the loop filter may be omitted and the decoded video blocks may be provided directly by adder 62 to DPB 64. Video encoder 20 may take the form of a fixed or programmable hardware unit, or may be distributed among one or more of the illustrated fixed or programmable hardware units.

[0060] Video data memory 40 may store video data to be encoded by components of video encoder 20. The video data in video data memory 40 may be obtained, for example, from Figure 1 The video data memory 40 and the DPB 64 are obtained from the video source 18 shown. The DPB 64 is a buffer that stores reference video data (reference frames or pictures) for use by the video encoder 20 (e.g., in intra-frame or inter-frame prediction coding mode) when encoding video data. The video data memory 40 and the DPB 64 may be formed by any of a variety of memory devices. In various examples, the video data memory 40 may be on-chip with other components of the video encoder 20, or off-chip relative to those components.

[0061] like Figure 2As shown in , after receiving the video data, the partitioning unit 45 within the prediction processing unit 41 partitions the video data into video blocks. This partitioning operation may also include partitioning the video frame into strips, tiles (e.g., a set of video blocks) or other larger coding units (Coding Unit, CU) according to a predefined splitting structure associated with the video data (e.g., a quadtree (Quad-Tree, QT) structure). A video frame is or can be considered to be a two-dimensional array or matrix of samples with sample values. The samples in the array may also be referred to as pixels or pels. The number of samples in the horizontal and vertical directions (or axes) of the array or picture defines the size and / or resolution of the video frame. The video frame may be divided into multiple video blocks by (for example) using QT partitioning. A video block is also or can be considered to be a two-dimensional array or matrix of samples with sample values, but the size of the video block is smaller than the video frame. The number of samples in the horizontal and vertical directions (or axes) of the video block defines the size of the video block. The video block may be further divided into one or more block partitions or sub-blocks (which may again form blocks) by, for example, iteratively using QT partitioning, binary-tree (BT) partitioning, ternary-tree (TT) partitioning, or any combination thereof. It should be noted that the term "block" or "video block" as used herein may be a portion of a frame or picture, in particular a rectangular (square or non-square) portion. With reference to, for example, HEVC and VVC, a block or video block may be or correspond to a coding tree unit (CTU), a CU, a prediction unit (PU) or a transform unit (TU) and / or may be or correspond to a corresponding block, such as a coding tree block (CTB), a coding block (CB), a prediction block (PB) or a transform block (TB). Alternatively or additionally, a block or video block may be or correspond to a sub-block of a CTB, CB, PB, TB, etc.

[0062] The prediction processing unit 41 may select one of a plurality of feasible prediction coding modes for the current video block based on the error results (e.g., code rate and distortion level), such as one of one or more inter-frame prediction coding modes in a plurality of intra-frame prediction coding modes. The prediction processing unit 41 may provide the resulting intra-frame prediction coding block (e.g., prediction block) or inter-frame prediction coding block (e.g., prediction block) to the adder 50 to generate a residual block, and to the adder 62 to reconstruct the coding block for subsequent use as part of a reference frame. The prediction processing unit 41 also provides syntax elements (such as motion vectors, intra-frame mode indicators, partition information, and other such syntax information) to the entropy coding unit 56.

[0063] To select an appropriate intra-prediction coding mode for the current video block, intra-prediction processing unit 46 within prediction processing unit 41 may perform intra-prediction coding of the current video block relative to one or more neighboring blocks in the same frame as the current block to be encoded to provide spatial prediction. Motion estimation unit 42 and motion compensation unit 44 within prediction processing unit 41 may perform inter-prediction coding of the current video block relative to one or more prediction blocks in one or more reference frames to provide temporal prediction. Video encoder 20 may perform multiple encoding passes, for example, to select an appropriate coding mode for each block of video data.

[0064] In some embodiments, motion estimation unit 42 determines an inter-prediction mode for a current video frame by generating a motion vector according to a predetermined pattern within a sequence of video frames, the motion vector indicating the displacement of a video block within the current video frame relative to a prediction block within a reference frame. Motion estimation performed by motion estimation unit 42 may be a process of generating a motion vector that may estimate motion for a video block. For example, a motion vector may indicate the displacement of a video block within a current video frame or picture relative to a prediction block within a reference frame. The predetermined pattern may designate a video frame in a sequence as a P frame or a B frame. Intra BC unit 48 may determine a vector (e.g., a block vector) for intra BC coding in a manner similar to the motion vectors determined by motion estimation unit 42 for inter prediction, or may utilize motion estimation unit 42 to determine the block vector.

[0065] In terms of pixel differences, the prediction block of the video block may be or may correspond to a block or reference block of a reference frame that closely matches the video block to be encoded, and the pixel difference may be determined by the sum of absolute differences (SAD), the sum of square differences (SSD), or other difference metrics. In some embodiments, the video encoder 20 may calculate values ​​for sub-integer pixel positions of the reference frame stored in the DPB 64. For example, the video encoder 20 may interpolate values ​​for quarter-pixel positions, eighth-pixel positions, or other fractional pixel positions of the reference frame. Thus, the motion estimation unit 42 may perform a motion search relative to the full pixel positions and the fractional pixel positions and output a motion vector with fractional pixel precision.

[0066] Motion estimation unit 42 calculates a motion vector for a video block in an inter-prediction coded frame by comparing the position of the video block to the position of a prediction block of a reference frame selected from a first reference frame list (List 0) or a second reference frame list (List 1), each of which identifies one or more reference frames stored in DPB 64. Motion estimation unit 42 sends the calculated motion vector to motion compensation unit 44 and then to entropy encoding unit 56.

[0067] Motion compensation performed by motion compensation unit 44 may involve extracting or generating a prediction block based on a motion vector determined by motion estimation unit 42. Upon receiving a motion vector for a current video block, motion compensation unit 44 may locate the prediction block pointed to by the motion vector in one of a reference frame list, retrieve the prediction block from DPB 64, and forward the prediction block to adder 50. Adder 50 then forms a residual block of pixel difference values ​​by subtracting the pixel values ​​of the prediction block provided by motion compensation unit 44 from the pixel values ​​of the current video block being encoded. The pixel difference values ​​forming the residual block may include a luma difference component or a chroma difference component or both. Motion compensation unit 44 may also generate syntax elements associated with a video block of a video frame for use by video decoder 30 when decoding the video block of a video frame. The syntax elements may include, for example, syntax elements defining a motion vector for identifying a prediction block, any flag indicating a prediction mode, or any other syntax information described herein. It should be noted that motion estimation unit 42 and motion compensation unit 44 may be integrated together, but for conceptual purposes, the syntax elements are described in detail below. Figure 2 Shown separately in.

[0068] In some embodiments, the intra BC unit 48 may generate vectors and extract prediction blocks in a manner similar to that described above in conjunction with the motion estimation unit 42 and the motion compensation unit 44, but these prediction blocks are in the same frame as the current block being encoded, and these vectors are referred to as block vectors rather than motion vectors. Specifically, the intra BC unit 48 may determine the intra prediction mode to be used to encode the current block. In some examples, the intra BC unit 48 may encode the current block using various intra prediction modes, for example, during different encoding passes, and test their performance through rate-distortion analysis. Next, the intra BC unit 48 may select a suitable intra prediction mode to use among the various tested intra prediction modes and generate an intra mode indicator accordingly. For example, the intra BC unit 48 may calculate rate-distortion values ​​for the various tested intra prediction modes using rate-distortion analysis, and select the intra prediction mode with the best rate-distortion characteristics among the tested modes as the suitable intra prediction mode to use. The rate-distortion analysis generally determines the amount of distortion (or error) between a coded block and the original uncoded block that was encoded to generate the coded block, as well as the bit rate (i.e., the number of bits) used to generate the coded block. Intra BC unit 48 may calculate ratios from the distortions and rates for the various coded blocks to determine which intra-prediction mode exhibits the best rate-distortion value for the block.

[0069] In other examples, intra BC unit 48 may use, in whole or in part, motion estimation unit 42 and motion compensation unit 44 to perform such functions for intra BC prediction in accordance with embodiments described herein. In either case, for intra block copying, the prediction block may be a block that is considered to closely match the block to be encoded in terms of pixel differences, which may be determined by SAD, SSD, or other difference metrics, and identification of the prediction block may include calculating values ​​for sub-integer pixel positions.

[0070] Regardless of whether the prediction block is from the same frame according to intra-frame prediction or from a different frame according to inter-frame prediction, the video encoder 20 can form pixel difference values ​​by subtracting the pixel values ​​of the prediction block from the pixel values ​​of the current video block being encoded, thereby forming a residual block. The pixel difference values ​​forming the residual block may include both luma component differences and chroma component differences.

[0071] As an alternative to the inter-frame prediction performed by the motion estimation unit 42 and the motion compensation unit 44 or the intra-frame block copy prediction performed by the intra BC unit 48 as described above, the intra-frame prediction processing unit 46 may perform intra-frame prediction on the current video block. Specifically, the intra-frame prediction processing unit 46 may determine an intra-frame prediction mode for encoding the current block. For example, the intra-frame prediction processing unit 46 may use various intra-frame prediction modes to encode the current block, for example, during different encoding passes, and the intra-frame prediction processing unit 46 (or in some examples, the mode selection unit) may select a suitable intra-frame prediction mode from the tested intra-frame prediction modes to use. The intra-frame prediction processing unit 46 may provide information indicating the intra-frame prediction mode selected for the block to the entropy encoding unit 56. The entropy encoding unit 56 may encode the information indicating the selected intra-frame prediction mode into the bitstream.

[0072] After the prediction processing unit 41 determines the prediction block for the current video block via inter-frame prediction or intra-frame prediction, the adder 50 forms a residual block by subtracting the prediction block from the current video block. The residual video data in the residual block may be included in one or more TUs and provided to the transform processing unit 52. The transform processing unit 52 transforms the residual video data into transform coefficients using a transform such as a discrete cosine transform (DCT) or a conceptually similar transform.

[0073] Transform processing unit 52 may send the resulting transform coefficients to quantization unit 54. Quantization unit 54 quantizes the transform coefficients to further reduce the bit rate. The quantization process may also reduce the bit depth associated with some or all of the coefficients. The degree of quantization may be modified by adjusting a quantization parameter. In some examples, quantization unit 54 may then perform a scan on the matrix including the quantized transform coefficients. Optionally, entropy encoding unit 56 may perform the scan.

[0074] After quantization, entropy coding unit 56 may encode the quantized transform coefficients into a video bitstream using an entropy coding technique, such as Context Adaptive Variable Length Coding (CAVLC), Context Adaptive Binary Arithmetic Coding (CABAC), Syntax-based context-adaptive Binary Arithmetic Coding (SBAC), Probability Interval Partitioning Entropy (PIPE) encoding, or another entropy coding method or technique. The encoded bitstream may then be sent to a video bitstream such as a video stream. Figure 1 The video decoder 30 shown, or archived as Figure 1 The video frame may be encoded in the storage device 32 for later transmission to or retrieval by the video decoder 30. The entropy encoding unit 56 may also encode the motion vectors and other syntax elements for the current video frame being encoded using entropy encoding techniques.

[0075] Inverse quantization unit 58 and inverse transform processing unit 60 apply inverse quantization and inverse transform, respectively, to reconstruct the residual block in the pixel domain for generating a reference block for predicting other video blocks. A reconstructed residual block thereof may be generated. As noted above, motion compensation unit 44 may generate a motion compensated prediction block from one or more reference blocks of a frame stored in DPB 64. Motion compensation unit 44 may also apply one or more interpolation filters to the prediction block to calculate sub-integer pixel values ​​for use in motion estimation.

[0076] Adder 62 adds the reconstructed residual block to the motion compensated prediction block generated by motion compensation unit 44 to generate a reference block for storage in DPB 64. The reference block may then be used as a prediction block by intra BC unit 48, motion estimation unit 42, and motion compensation unit 44 to inter-predict another video block in a subsequent video frame.

[0077] Figure 3 30 is a block diagram showing an exemplary video decoder 30 according to some embodiments of the present application. The video decoder 30 includes a video data memory 79, an entropy decoding unit 80, a prediction processing unit 81, an inverse quantization unit 86, an inverse transform processing unit 88, an adder 90, and a DPB 92. The prediction processing unit 81 further includes a motion compensation unit 82, an intra-frame prediction unit 84, and an intra-frame BC unit 85. The video decoder 30 may perform the above combined Figure 2The encoding process is substantially the inverse of the decoding process described with respect to video encoder 20. For example, motion compensation unit 82 may generate prediction data based on motion vectors received from entropy decoding unit 80, and intra-prediction unit 84 may generate prediction data based on intra-prediction mode indicators received from entropy decoding unit 80.

[0078] In some examples, units of the video decoder 30 may be tasked to perform embodiments of the present application. In addition, in some examples, embodiments of the present disclosure may be dispersed in one or more of the multiple units of the video decoder 30. For example, the intra BC unit 85 may perform embodiments of the present application alone or in combination with other units of the video decoder 30 (such as the motion compensation unit 82, the intra prediction unit 84, and the entropy decoding unit 80). In some examples, the video decoder 30 may not include the intra BC unit 85, and the functions of the intra BC unit 85 may be performed by other components of the prediction processing unit 81 (such as the motion compensation unit 82).

[0079] The video data memory 79 may store video data, such as an encoded video bitstream, to be decoded by other components of the video decoder 30. The video data stored in the video data memory 79 may be obtained, for example, from the storage device 32, from a local video source (such as a camera), via a wired or wireless network communication of video data, or by accessing a physical data storage medium (e.g., a flash drive or hard disk). The video data memory 79 may include a coded picture buffer (CPB) that stores encoded video data from an encoded video bitstream. The DPB 92 of the video decoder 30 stores reference video data for use by the video decoder 30 when decoding the video data (e.g., in an intra-frame or inter-frame prediction decoding mode). The video data memory 79 and the DPB 92 may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM)), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. For illustrative purposes, the video data memory 79 and the DPB 92 are shown in FIG. Figure 3 9 as two different components of video decoder 30. However, it will be apparent to those skilled in the art that video data memory 79 and DPB 92 may be provided by the same memory device or separate memory devices. In some examples, video data memory 79 may be on-chip with other components of video decoder 30, or off-chip relative to those components.

[0080] During the decoding process, video decoder 30 receives an encoded video bitstream representing video blocks of an encoded video frame and associated syntax elements. Video decoder 30 may receive syntax elements at the video frame level and / or the video block level. Entropy decoding unit 80 of video decoder 30 may decode the bitstream using entropy decoding techniques to obtain quantization coefficients, motion vectors or intra-frame prediction mode indicators, and other syntax elements. Entropy decoding unit 80 then forwards the motion vectors or intra-frame prediction mode indicators and other syntax elements to prediction processing unit 81.

[0081] When a video frame is encoded as an intra-prediction coded (e.g., I) frame or for intra-coded prediction blocks in other types of frames, intra-prediction unit 84 of prediction processing unit 81 may generate prediction data for a video block of the current video frame based on a signaled intra-prediction mode and reference data from a previously decoded block of the current frame.

[0082] When the video frame is encoded as an inter-frame prediction coded (i.e., B or P) frame, the motion compensation unit 82 of the prediction processing unit 81 generates one or more prediction blocks for the video block of the current video frame based on the motion vectors and other syntax elements received from the entropy decoding unit 80. Each of the prediction blocks may be generated from a reference frame within one of the reference frame lists. The video decoder 30 may construct the reference frame lists, e.g., List 0 and List 1, using a default construction technique based on the reference frames stored in the DPB 92.

[0083] In some examples, when a video block is decoded according to the intra BC mode described herein, intra BC unit 85 of prediction processing unit 81 generates a prediction block for the current video block based on the block vector and other syntax elements received from entropy decoding unit 80. The prediction block may be within a reconstructed region of the same picture processed by video encoder 20 as the current video block.

[0084] The motion compensation unit 82 and / or the intra BC unit 85 determine prediction information for the video block of the current video frame by parsing the motion vector and other syntax elements, and then use the prediction information to generate a prediction block for the current video block being decoded. For example, the motion compensation unit 82 uses some of the received syntax elements to determine the prediction mode (e.g., intra prediction or inter prediction) for decoding the video block of the video frame, the inter prediction frame type (e.g., B or P), the construction information for one or more of the reference frame lists for the frame, the motion vector for each inter prediction encoded video block of the frame, the inter prediction state for each inter prediction encoded video block of the frame, and other information for decoding the video block in the current video frame.

[0085] Similarly, the intra BC unit 85 may use some of the received syntax elements, such as a flag to determine whether the current video block is predicted using intra BC mode, construction information of which video blocks of the frame are within the reconstruction region and should be stored in the DPB 92, a block vector for each intra BC predicted video block of the frame, an intra BC prediction state for each intra BC predicted video block of the frame, and other information for decoding the video blocks in the current video frame.

[0086] Motion compensation unit 82 may also perform interpolation using interpolation filters as used during encoding of the video blocks by video encoder 20 to calculate interpolated values ​​for sub-integer pixels of reference blocks. In this case, motion compensation unit 82 may determine the interpolation filters used by video encoder 20 from the received syntax elements and use these interpolation filters to generate the prediction blocks.

[0087] Inverse quantization unit 86 inverse quantizes the quantized transform coefficients provided in the bitstream and decoded by entropy decoding unit 80, using the same quantization parameters calculated by video encoder 20 for each video block in the video frame to determine the degree of quantization. Inverse transform processing unit 88 applies an inverse transform (e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients to reconstruct the residual block in the pixel domain.

[0088] After the motion compensation unit 82 or the intra BC unit 85 generates a prediction block for the current video block based on the vector and other syntax elements, the adder 90 reconstructs the decoded video block for the current video block by adding the residual block from the inverse transform processing unit 88 to the corresponding prediction block generated by the motion compensation unit 82 and the intra BC unit 85. The decoded video block may also be referred to as a reconstructed block of the current video block. A loop filter 91 (such as a deblocking filter, an SAO filter, and / or an ALF) may be located between the adder 90 and the DPB 92 to further process the decoded video block. In some examples, the loop filter 91 may be omitted, and the decoded video block may be provided directly to the DPB 92 by the adder 90. The decoded video blocks in a given frame are then stored in the DPB 92, which stores reference frames for subsequent motion compensation of the next video block. The DPB 92 or a memory device separate from the DPB 92 may also store the decoded video for later presentation on a display device (e.g., Figure 1 on a display device 34).

[0089] In a typical video encoding and decoding process (e.g., including a video encoding process and a video decoding process), a video sequence generally includes an ordered set of frames or pictures. Each frame may include three sample arrays, denoted as SL, SCb, and SCr. SL is a two-dimensional array of luma samples. SCb is a two-dimensional array of Cb chroma samples. SCr is a two-dimensional array of Cr chroma samples. In other cases, a frame may be monochrome and therefore include only a two-dimensional array of luma samples.

[0090] like Figure 4A As shown in , the video encoder 20 (or more specifically, the partitioning unit 45) generates an encoded representation of a frame by first partitioning the frame into a set of CTUs. A video frame may include an integer number of CTUs arranged consecutively from left to right and from top to bottom in a raster scan order. Each CTU is the largest logical coding unit, and the width and height of the CTU are signaled by the video encoder 20 in a sequence parameter set so that all CTUs in a video sequence have the same size, one of 128×128, 64×64, 32×32, and 16×16. It should be noted, however, that the CTUs in the present disclosure are not necessarily limited to a specific size. As Figure 4B As shown in , each CTU may include one CTB for luma samples, two corresponding coding tree blocks for chroma samples, and syntax elements for encoding and decoding samples of the coding tree blocks. The syntax elements describe the properties of different types of units of coding pixel blocks and how the video sequence can be reconstructed at the video decoder 30, including inter-frame prediction or intra-frame prediction, intra-frame prediction mode, motion vectors, and other parameters. In a monochrome picture or a picture with three separate color planes, a CTU may include a single coding tree block and syntax elements for encoding and decoding samples of the coding tree block. The coding tree block may be an N×N sample block.

[0091] To achieve better performance, video encoder 20 may recursively perform tree partitioning, such as binary tree partitioning, ternary tree partitioning, quadtree partitioning, or a combination thereof, on the coding tree block of the CTU and divide the CTU into smaller CUs. Figure 4C As depicted in , a 64×64 CTU 400 is first partitioned into four smaller CUs, each CU having a block size of 32×32. Among the four smaller CUs, CU 410 and CU 420 are partitioned into four CUs of a block size of 16×16, respectively. Two 16×16 CUs 430 and CU 440 are further partitioned into four CUs of a block size of 8×8, respectively. Figure 4D Depicted is a diagram showing Figure 4C The quadtree data structure of the final result of the partitioning process of CTU 400 depicted in FIG. 4 is a quadtree data structure, each leaf node of the quadtree corresponds to a CU of each size ranging from 32×32 to 8×8. Figure 4BEach CU may include a CB of luma samples and two corresponding coding blocks of chroma samples of the same size frame, and syntax elements for encoding and decoding the samples of the coding blocks. In a monochrome picture or a picture with three separate color planes, a CU may include a single coding block and syntax structures for encoding and decoding the samples of the coding block. It should be noted that Figure 4C and Figure 4D The quadtree partitioning depicted in FIG is for illustrative purposes only, and one CTU may be split into CUs based on quadtree / ternary tree / binary tree partitioning to adapt to varying local characteristics. In a multi-type tree structure, one CTU is divided by a quadtree structure, and each quadtree leaf CU may be further divided by a binary tree structure and a ternary tree structure. Figure 4E As shown, there are multiple possible partition types for a coding block with a width of W and a height of H, namely, quadruple partition, vertical binary partition, horizontal binary partition, vertical ternary partition, vertical extended ternary partition, horizontal ternary partition and horizontal extended ternary partition.

[0092] In some embodiments, the video encoder 20 may further divide the coding block of the CU into one or more M×NPBs. The PB may include a rectangular (square or non-square) sample block to which the same prediction (inter or intra) is applied. The PU of the CU may include a PB of luma samples, two corresponding PBs of chroma samples, and syntax elements for predicting the PB. In a monochrome picture or a picture with three separate color planes, the PU may include a single PB and a syntax structure for predicting the PB. The video encoder 20 may generate a predicted luma block, a predicted Cb block, and a predicted Cr block for the luma PB, Cb PB, and Cr PB of each PU of the CU.

[0093] Video encoder 20 may use intra prediction or inter prediction to generate a prediction block for a PU. If video encoder 20 uses intra prediction to generate a prediction block for a PU, video encoder 20 may generate the prediction block for the PU based on decoded samples of a frame associated with the PU. If video encoder 20 uses inter prediction to generate a prediction block for a PU, video encoder 20 may generate the prediction block for the PU based on decoded samples of one or more frames other than the frame associated with the PU.

[0094] After the video encoder 20 generates the predicted luma block, the predicted Cb block, and the predicted Cr block for one or more PUs of a CU, the video encoder 20 may generate a luma residual block for the CU by subtracting the predicted luma block of the CU from the original luma coding block of the CU, so that each sample in the luma residual block of the CU indicates the difference between a luma sample in one of the predicted luma blocks of the CU and a corresponding sample in the original luma coding block of the CU. Similarly, the video encoder 20 may generate a Cb residual block and a Cr residual block for the CU, respectively, so that each sample in the Cb residual block of the CU indicates the difference between a Cb sample in one of the predicted Cb blocks of the CU and a corresponding sample in the original Cb coding block of the CU, and each sample in the Cr residual block of the CU may indicate the difference between a Cr sample in one of the predicted Cr blocks of the CU and a corresponding sample in the original Cr coding block of the CU.

[0095] In addition, if Figure 4C As shown in , the video encoder 20 may use quadtree partitioning to decompose the luma residual block, Cb residual block, and Cr residual block of a CU into one or more luma transform blocks, Cb transform blocks, and Cr transform blocks, respectively. A transform block may include a rectangular (square or non-square) sample block to which the same transform is applied. A TU of a CU may include a transform block of luma samples, two corresponding transform blocks of chroma samples, and syntax elements for transforming the transform block samples. Therefore, each TU of a CU may be associated with a luma transform block, a Cb transform block, and a Cr transform block. In some examples, the luma transform block associated with a TU may be a sub-block of the luma residual block of the CU. The Cb transform block may be a sub-block of the Cb residual block of the CU. The Cr transform block may be a sub-block of the Cr residual block of the CU. In a monochrome picture or a picture with three separate color planes, a TU may include a single transform block and a syntax structure for transforming the samples of the transform block.

[0096] The video encoder 20 may apply one or more transforms to the luma transform block of the TU to generate a luma coefficient block for the TU. The coefficient block may be a two-dimensional array of transform coefficients. The transform coefficient may be a scalar. The video encoder 20 may apply one or more transforms to the Cb transform block of the TU to generate a Cb coefficient block for the TU. The video encoder 20 may apply one or more transforms to the Cr transform block of the TU to generate a Cr coefficient block for the TU.

[0097] After generating a coefficient block (e.g., a luma coefficient block, a Cb coefficient block, or a Cr coefficient block), video encoder 20 may quantize the coefficient block. Quantization generally refers to a process in which transform coefficients are quantized to potentially reduce the amount of data used to represent the transform coefficients, thereby providing further compression. After video encoder 20 quantizes the coefficient block, video encoder 20 may apply an entropy coding technique to encode syntax elements indicating the quantized transform coefficients. For example, video encoder 20 may perform CABAC on the syntax elements indicating the quantized transform coefficients. Finally, video encoder 20 may output a bitstream including a sequence of bits that form a representation of an encoded frame and associated data, and the bitstream is stored in storage device 32 or sent to target device 14.

[0098] After receiving the bitstream generated by the video encoder 20, the video decoder 30 may parse the bitstream to obtain syntax elements from the bitstream. The video decoder 30 may reconstruct a frame of video data based at least in part on the syntax elements obtained from the bitstream. The process of reconstructing the video data is generally the inverse of the encoding process performed by the video encoder 20. For example, the video decoder 30 may perform an inverse transform on a coefficient block associated with a TU of the current CU to reconstruct a residual block associated with the TU of the current CU. The video decoder 30 also reconstructs the coding block of the current CU by adding samples of the prediction block for the PU of the current CU to corresponding samples of the transform block of the TU of the current CU. After reconstructing the coding block for each CU of the frame, the video decoder 30 may reconstruct the frame.

[0099] As mentioned above, video codecs mainly use two modes, namely, intra-frame prediction (or intra-frame prediction) and inter-frame prediction (or inter-frame prediction) to achieve video compression. It should be noted that intra block copy (IBC) can be regarded as intra-frame prediction or a third mode. Between the two modes, inter-frame prediction contributes more to codec efficiency than intra-frame prediction because motion vectors are used to predict the current video block from the reference video block.

[0100] However, with the ever-improving video data capture technology and more refined video block sizes for retaining details in the video data, the amount of data required to represent the motion vector of the current frame has also increased significantly. One way to overcome this challenge is to benefit from the fact that not only a group of neighboring CUs in both the spatial domain and the temporal domain have similar video data for prediction purposes, but the motion vectors between these neighboring CUs are also similar. Therefore, the motion information of spatially neighboring CUs and / or temporally co-located CUs can be used as an approximation of the motion information (e.g., motion vector) of the current CU by exploring the spatial and temporal correlation of the spatially neighboring CUs and / or the temporally co-located CUs, which is also referred to as the "motion vector predictor (MVP)" of the current CU.

[0101] Instead of encoding the actual motion vector of the current CU into the video bitstream (e.g., the actual motion vector is obtained by combining Figure 2 The motion vector prediction factor of the current CU is subtracted from the actual motion vector of the current CU to generate a motion vector difference (MVD) of the current CU. By doing so, the motion vector determined by the motion estimation unit 42 for each CU of the frame does not need to be encoded into the video bitstream, and the amount of data used to represent motion information in the video bitstream can be significantly reduced.

[0102] As in the process of selecting a prediction block in a reference frame during inter-frame prediction of a coding block, both the video encoder 20 and the video decoder 30 may adopt a set of rules for constructing a motion vector candidate list (also referred to as a "merge list") for the current CU using those potential candidate motion vectors associated with the spatially neighboring CUs and / or temporally co-located CUs of the current CU, and then selecting one member from the motion vector candidate list as the motion vector predictor for the current CU. By doing so, the motion vector candidate list itself does not need to be sent from the video encoder 20 to the video decoder 30, and the index of the selected motion vector predictor within the motion vector candidate list is sufficient for the video encoder 20 and the video decoder 30 to encode and decode the current CU using the same motion vector predictor within the motion vector candidate list. Therefore, only the index of the selected motion vector predictor needs to be sent from the video encoder 20 to the video decoder 30. A brief discussion of transform coefficient encoding and decoding in a block-based video encoding and decoding process (e.g., in an enhanced compression model (ECM)) is provided herein. Specifically, each transform block is first divided into a plurality of coefficient groups (CGs), wherein each coefficient group includes transform coefficients of a 4×4 sub-block of a luminance component and a 2×2 sub-block of a chrominance component. Encoding and decoding are performed on the transform coefficients in the transform block in units of coefficient groups. For example, the coefficient groups within the transform block are scanned and encoded based on a first predetermined scanning order. When encoding each coefficient group, the transform coefficients of the coefficient group are scanned based on a second predetermined scanning order within each sub-block. In ECM, the same top-left scanning order is applied to scan the coefficient groups within the transform block and the different transform coefficients in each coefficient group (for example, both the first predetermined scanning order and the second predetermined scanning order are top-left scanning orders). Figure 5 is a graphical representation showing a top-left scan order of transform coefficients in a coefficient group according to some examples. Figure 5 The numbers 0-15 in indicate the corresponding scanning order of each transform coefficient in the coefficient group.

[0103] According to the transform coefficient coding scheme in ECM, a flag is first signaled for each transform block to indicate whether the transform block includes any non-zero transform coefficients. In the case where there is at least one non-zero transform coefficient in the transform block, the position of the last non-zero transform coefficient scanned according to the top-left scanning order is explicitly signaled from the video encoder 20 to the video decoder 30. In the case where the position of the last non-zero transform coefficient is signaled, a flag is further signaled for all coefficient groups encoded before the last coefficient group (i.e., the coefficient group including the last non-zero coefficient). Accordingly, the flag indicates whether the corresponding coefficient group includes non-zero transform coefficients. If the flag of the coefficient group is equal to zero (indicating that all transform coefficients in the coefficient group are zero), no further information needs to be sent for the coefficient group. Otherwise (e.g., the flag of the coefficient group is equal to 1), the absolute value and sign of each transform coefficient in the coefficient group are signaled in the bitstream according to the scanning order. However, in the existing design, the sign of the transform coefficient is bypassed and decoded (e.g., the context model is not applied), resulting in inefficient transform coding in the current design. Consistent with the present disclosure, an improved LFNST process with sign prediction of transform coefficients is described in more detail below, so that transform coding efficiency can be improved.

[0104] Figure 6 is a graphical representation showing the LFNST process according to some examples. In VVC, after the primary transform, a secondary transform tool (e.g., LFNST) is applied to compress the energy of the transform coefficients of the intra-coded blocks. Figure 6 As shown in FIG, a forward LFNST 604 is applied between a forward main transform 603 and a quantization 605 at the video encoder 20, and an inverse LFNST 608 is applied between an inverse quantization 607 and an inverse main transform 609 at the video decoder 30. For example, the LFNST process may include the forward LFNST 604 and the inverse LFNST 608. As some examples, for the 4×4 forward LFNST 604, there may be 16 input coefficients; for the 8×8 forward LFNST 604, there may be 64 input coefficients; for the 4×4 inverse LFNST 608, there may be 8 input coefficients; and for the 8×8 inverse LFNST 608, there may be 16 input coefficients.

[0105] In the positive LFNST 604, a non-separable transform with a varying transform size is applied based on the size of the coding block, which can be depicted using a matrix multiplication process. For example, assume that the positive LFNST 604 is applied to a 4×4 block. The samples in the 4×4 block can be represented using a matrix X, as shown in the following expression (1):

[0106]

[0107] The matrix X can be serialized as a vector As shown in the following expression (2):

[0108]

[0109] In the above expression (1) or (2), X represents the coefficient matrix obtained by the forward principal transformation 603, and X ij represents the principal transformation coefficient in matrix X. Then, according to expression (3), the forward LFNST 604 is applied as follows:

[0110]

[0111] In the above expression (3), represents the transformation coefficient after the forward LFNST 604, and T represents the transformation kernel (e.g., transformation matrix). In the above example, since X is a 4×4 matrix, T is a 16×16 matrix. Subsequently, the 16×1 vector is reorganized into a 4×4 block (e.g., a coefficient matrix of size 4×4) according to a predetermined scan order. The first transformation coefficient before the second transformation coefficient in the vector can be associated with a scan index smaller than that of the second transformation coefficient in the 4×4 block.

[0112] In some embodiments, a simplified non-separable transformation kernel can be applied during the LFNST process. For example, based on the above expression (3), the forward LFNST 604 is based on direct matrix multiplication, which is expensive in terms of computational operations and the memory source for storing the transformation coefficients. Therefore, by mapping an N-dimensional vector to an R-dimensional vector in a different space, where R < N, a simplified non-separable transformation kernel can be used in the LFNST design to reduce the implementation cost of the LFNST process. For example, instead of using an N×N matrix for the transformation kernel, as shown in expression (4), an R×N matrix is used as the transformation kernel in the forward LFNST 604:

[0113]

[0114] In the above expression (4), T R×N is generated by selecting the first R bases of the original N-dimensional transformation kernel (i.e., N×N). Additionally, assuming that T R×N is orthogonal, the inverse transformation matrix of the inverse LFNST 608 is the transpose of the forward transformation matrix.

[0115] For 8×8 LFNST, if the factor N / R=4 is applied, the 64×64 transform matrix is ​​simplified to a 16×48 transform matrix for the forward LFNST 604, and the 64×64 inverse transform matrix is ​​simplified to a 48×16 inverse transform matrix for the inverse LFNST 608. This is achieved by applying the LFNST process to the 8×8 sub-block in the upper left region of the main transform coefficients. Specifically, when the 16×48 forward LFNST is applied, it takes as input the 48 transform coefficients from the three 4×4 sub-blocks in the upper left 8×8 sub-block (excluding its lower right 4×4 sub-block). In some examples, the LFNST process is limited to being applicable only when all transform coefficients outside the upper left 4×4 sub-block are zero, indicating that when LFNST is applied, all main-only transform coefficients must be zero. Furthermore, to control the worst-case complexity (in terms of multiplications per pixel), the LFNST matrices for 4×4 and 8×8 coding blocks are forced to undergo 8×16 and 8×48 transformations, respectively. For 4×M and M×4 coding blocks (M≥4), the non-separable transformation matrix for LFNST is 16×16.

[0116] In the LFNST transform signaling, there are a total of four transform sets, and two inseparable transform cores per transform set are enabled in the LFNST design. A transform set is selected from the four transform sets according to the intra prediction mode of the intra block. The mapping from the intra prediction mode to the transform set is predetermined, as shown in Table 1 below. If one of the three cross-component linear model (CCLM) modes (e.g., INTRA_LT_CCLM, INTRA_T_CCLM, or INTRA_L_CCLM) is used for the current block (81<=predModeIntra<=83), transform set "0" is selected for the current chroma block. For each transform set, the selected inseparable secondary transform candidate is indicated by signaling the LFNST index in the bitstream.

[0117] Table 1

[0118] IntraPredMode set IntraPredMode<0 1 0<=IntraPredMode<=1 0 2<=IntraPredMode<=12 1 13<=IntraPredMode<=23 2 24<=IntraPredMode<=44 3 45<=IntraPredMode<=55 2 56<=IntraPredMode<=80 1 81<=IntraPredMode<=83 0

[0119] In some examples, because LFNST is limited to applying to intra blocks when all transform coefficients outside the first 16×16 sub-block are zero, the LFNST index signaling depends on the position of the last significant (i.e., non-zero) transform coefficient. For example, for 4×4 coding blocks and 8×8 coding blocks, the LFNST index is signaled only when the position of the last significant transform coefficient is less than 8. For other coding block sizes, the LFNST index is signaled only when the position of the last significant transform coefficient is less than 16. Otherwise (i.e., the LFNST index is not signaled), the LFNST index is inferred to be zero, i.e., LFNST is disabled.

[0120] In addition, in order to reduce the size of the buffer used to cache transform coefficients, LFNST is not allowed when the width or height of the current coding block is larger than the maximum transform size (i.e., 64) signaled in the sequence parameter set (SPS). In addition, LFNST is only applied when the main transform is DCT2. In addition, LFNST is applied to intra-frame coded blocks in both intra-frame slices and inter-frame slices, as well as to both luma and chroma components. If dual tree or local tree is enabled (where the partitions of luma and chroma components are not aligned), LFNST indexes are signaled separately for luma and chroma components (i.e., different LFNST transforms may be applied to luma and chroma components). Otherwise, when a single tree is applied (where the partitions of luma and chroma components are aligned), LFSNT is only applied to the luma component with a single LFNST index signaled.

[0121] The LFNST design in ECM is similar to that in VVC, except that an additional LFNST kernel is introduced to provide better energy compression of residual samples of large block size. Specifically, when the width or height of the transform block is not less than 16, a new LFNST transform is introduced to the upper left region of the low-frequency transform coefficients generated from the main transform. In the current ECM, Figure 7 As shown in , the low frequency region includes six 4×4 sub-blocks in the upper left corner of the main transform coefficients (eg, Figure 7 (a) six 4×4 sub-blocks shown in grey in A). In this case, the number of coefficient inputs to the positive LFNST 604 is 96. In addition, in order to control the worst case computational complexity, the number of coefficient outputs of the positive LFNST 604 is set to 32.

[0122] Specifically, for a W×H transform block, where W>=16 and H>=16, a 32×96 positive LFNST is applied, which takes 96 transform coefficients from the six 4×4 sub-blocks in the upper left region as input and outputs 32 transform coefficients. On the other hand, the 8×8 LFNST in ECM utilizes the transform coefficients in all four 4×4 sub-blocks as input and outputs 32 transform coefficients (i.e., a 32×64 matrix for the positive LFNST 604 and a 64×32 matrix for the inverse LFNST 608). This is different from VVC, where the 8×8 LFNST is only applied to the three 4×4 sub-blocks in the upper left region and only 16 transform coefficients are generated (i.e., a 16×48 matrix for the positive LFNST 604 and a 48×16 matrix for the inverse LFNST 608). In addition, the total number of LFNST sets is increased from 4 in VVC to 35 in ECM. Similar to VVC, the selection of LFNST set depends on the intra prediction mode of the current coding unit, and each LFNST set includes three different transform kernels.

[0123] In some examples, in addition to the DCT2 transform used in HEVC, a Multiple Transform Selection (MTS) scheme is applied to transform the residuals of both inter-coded blocks and intra-coded blocks. The MTS scheme uses multiple transforms selected from DCT8 and DST7 transforms.

[0124] For example, two control flags are specified at the sequence level to enable the MTS scheme for intra mode and inter mode, respectively. When the MTS scheme is enabled at the sequence level, another CU-level flag is further signaled to indicate whether the MTS scheme is applied. In some embodiments, the MTS scheme is applied only to the luminance component. In addition, the MTS scheme is signaled only when the following conditions are met: (a) both the width and height are less than or equal to 32; (b) the coding block flag (CBF) is equal to one. If the MTS CU flag (MTS_CU_flag) is equal to zero, DCT2 is applied in both the horizontal and vertical directions. If the MTS CU flag is equal to one, two other flags are additionally signaled to indicate the transform types in the horizontal and vertical directions, respectively. The mapping between the MTS horizontal control flag (MTS_Hor_flag) and the MTS vertical control flag (MTS_Ver_flag) and the applied transforms is shown in Table 2 below.

[0125] Table 2

[0126]

[0127] Regarding the precision of the transform matrix, all MTS transform coefficients are 6-bit precision, which is the same as the DCT2 kernel transform. Assuming that VVC supports all transform sizes used in HEVC, all transform kernels used in HEVC remain the same as VVC, including 4-point, 8-point, 16-point and 32-point DCT-2 transforms and 4-point DST-7 transforms. In addition, other transform kernels including 64-point DCT-2, 4-point DCT-8, 8-point, 16-point, 32-point DST-7 and DCT-8 are additionally supported in the VVC transform design. In addition, in order to reduce the complexity of large-size DST-7 and DCT-8, when the width or height is equal to 32, for DST-7 transform blocks and DCT-8 transform blocks, high-frequency transform coefficients located outside the 16×16 low-frequency region are set to zero (also called zero output).

[0128] In VVC, in addition to DCT2, only DST7 transform core and DCT8 transform core are used for intra-frame coding and inter-frame coding. For intra-frame coding, the statistical characteristics of the residual signal usually depend on the intra-frame prediction mode. Additional main transforms can be beneficial to handle the diversity of residual characteristics.

[0129] Additional main transforms including DCT5, DST4, DST1 and identity transform (IDT) are used in ECM. In addition, the MTS set is set according to the TU size and intra-frame mode information. 16 different TU sizes can be considered, and 5 different categories can be considered for each TU size depending on the intra-frame mode information. For each category, 4 different transform pairs are considered (the same as the transform pairs of VVC). Although a total of 80 different categories can be considered, some of those different categories usually share the same transform set. Therefore, there are 58 (less than 80) unique entries in the resulting lookup table (LUT).

[0130] For angle modes, the joint symmetry on TU shape and intra prediction is considered. Therefore, mode i (i>34) with TU shape A×B can be mapped to the same category corresponding to mode j=(68-i) with TU shape B×A. However, for each transform pair, the order of the horizontal transform kernel and the vertical transform kernel is swapped. For example, a 16×4 block with mode 18 (horizontal prediction) and a 4×16 block with mode 50 (vertical prediction) are mapped to the same category, where the vertical transform kernel and the horizontal transform kernel are swapped. For wide-angle mode, the closest conventional angle mode is used for transform set determination. For example, mode 2 is used for all modes between -2 and -14. Similarly, mode 66 is used for modes 67 to 80.

[0131] Intra template matching prediction is an example of an intra prediction mode in which a prediction block is copied from a reconstructed portion of a current frame, where an L-shaped template of the reconstructed portion matches the current template. For a predetermined search range, the video encoder 20 searches for a template that is most similar to the current template in the reconstructed portion of the current frame (e.g., based on the SAD cost), and uses the corresponding block as the prediction block. The video encoder 20 then signals the use of this mode, and the same prediction operation is performed at the decoder side. The prediction signal is generated by matching the L-shaped causal neighbors of the current block with another block in a predetermined search area, such as Figure 8 As shown, including: (a) current CTU (R1); (b) upper left CTU (R2); (c) upper CTU (R3); and (d) left CTU (R4). Intra-frame template matching is enabled for CUs with sizes less than or equal to 64 in width and height. In addition, the intra-frame template matching prediction mode is indicated by signaling a flag at the CU level. When intra-frame template matching is applied to a coding block with a width or height between 4 and 16 (including 4 and 16), the main transform applied to the corresponding dimension is set to DST-VII. Otherwise (i.e., the width or height is less than 4 or greater than 16), DCT-II is applied to this dimension.

[0132] Fig. 9is a graphical representation of an exemplary process for symbol prediction according to some examples. In some embodiments, symbol prediction may be performed to estimate the sign of a transform coefficient in a transform block from samples of neighboring blocks of the transform block. The correctness of the estimated symbol may be encoded according to a context model to indicate whether the symbol prediction is correct. For example, in one context model, the difference between each estimated symbol may be encoded, and the corresponding true symbol has a "0" (or "1") to indicate that the estimated symbol is the same (or different) as the true symbol. In the case where a high percentage of symbols can be accurately estimated (e.g., 90% or 95% of the symbols are estimated correctly), the difference between the estimated symbol and the true symbol tends to be 0, which can be effectively entropy coded by CABAC when compared to the bypass-coded symbols of the transform coefficients in VVC.

[0133] In accordance with the present disclosure, other context models may be used to entropy encode the correctness of symbol prediction to further improve encoding and decoding efficiency. These other exemplary context models will be described in more detail below.

[0134] Typically, there is a high correlation between the samples at the boundary between the current block and its neighboring blocks, and the sign prediction scheme can use this high correlation to predict the sign of the transform coefficient of the current block. Fig. 9 As shown, assume that there are M non-zero transform coefficients in the current block (M symbols are each + or -). Then, the total number of possible symbol combinations is 2 M The symbol prediction scheme generates a corresponding hypothesis (e.g., the reconstructed samples at the top and left boundaries of the current block) using each symbol combination, and compares the reconstructed samples in the corresponding hypothesis with the samples inferred from the neighboring blocks to obtain the sample difference (e.g., SSD or SAD) between the reconstructed samples and the inferred samples. (In 2 M The possible symbol combinations are selected as the predicted symbols in the current block, which minimizes the sample point difference.

[0135] In such Fig. 9 In some embodiments shown, in order to generate a corresponding hypothesis for each combination of M symbols, the M corresponding transform coefficients may be processed by an inverse quantization operation and an inverse transform to obtain residual samples. The residual samples may be added to the predicted samples to obtain reconstructed samples, including the reconstructed samples at the top and left boundaries of the current block (shown in the L-shaped gray area 902).

[0136] In some embodiments, a cost function that measures the spatial discontinuity between samples at the boundary of the current block and its neighboring blocks is used to select a symbol combination. Instead of using the L2 norm (SSD), the cost function may be based on the L1 norm (SAD), as shown below in expression (5):

[0137]

[0138] In the above expression (5), B i,n (where i = -2, -1) represents the neighboring samples of the current block from the top neighboring block of the current block. m,j (where j = -2, -1) represents the neighboring sample points of the current block from the left neighboring block of the current block. 0,n and P m,0 Respectively represent the corresponding reconstructed sample points on the top and left boundaries of the current block. N and M represent the width and height of the current block, respectively. Fig.10 The corresponding sample point P of the current block is shown for calculating the cost function of symbol prediction 0,n and P m,0 And the corresponding sample points B of the adjacent blocks i,n and C m,j .

[0139] In some embodiments, a template-based hypothesis reconstruction method can be applied in a symbol prediction scheme to avoid the complexity of performing multiple inverse transforms. Each template can be a set of reconstructed sample points on the top and left boundaries of the current block and can be obtained by applying an inverse transform to a coefficient matrix, where certain coefficients are set to 1 and all other coefficients are equal to 0. Assuming that the inverse transform (e.g., DCT, DST) is linear, the corresponding hypothesis can be generated by a linear combination of a set of pre-computed templates.

[0140] In some embodiments, the prediction symbols are classified into two sets and each set is encoded by a single CABAC context. For example, the first set includes the prediction symbols for the transform coefficients at the upper left corner of the transform block, and the second set includes the prediction symbols for the transform coefficients at all other positions of the transform block.

[0141] As with HEVC, scalar quantization is used in VVC. In some embodiments, scalar quantization in VVC may be implemented as dependent scalar quantization. Dependent scalar quantization refers to a method in which the set of allowable reconstruction values ​​for a transform coefficient depends on the values ​​of the transform coefficient level that precedes the current transform coefficient level in the reconstruction order. The main effect of this method is that the allowable reconstruction vectors are more densely packed in the N-dimensional vector space (N represents the number of transform coefficients in the transform block) compared to the conventional independent scalar quantization used in HEVC. This means that for a given average number of allowable reconstruction vectors per N-dimensional unit volume, the average distortion between the input vector and its closest reconstruction vector is reduced.

[0142] Dependent scalar quantization may be achieved by (a) defining two scalar quantizers with different reconstruction levels, and (b) defining a procedure for switching between the two scalar quantizers. Fig.11Two exemplary scalar quantizers used in VVC dependent scalar quantization according to some embodiments of the present disclosure are shown. Fig.11 As shown, two scalar quantizers represented by Q0 and Q1 are applied in the quantization design of VVC. The position of the available reconstruction level is uniquely specified by the quantization step size Δ. In this embodiment, the selection between the two scalar quantizers Q0 and Q1 is not explicitly signaled in the bitstream. Instead, the quantizer used for the current transform coefficient is determined by the parity of the transform coefficient level that precedes the current transform coefficient in the encoding order of the video encoder 20 or the reconstruction order of the video decoder 30.

[0143] In some embodiments, the switching between the two scalar quantizers is accomplished via a state machine. Fig. 12A 12 is a graphical representation showing state transitions using a state machine with four states for dependent scalar quantization according to some examples. As shown in FIG12 , the state can take four different values ​​0, 1, 2, 3. It is uniquely determined by the parity of the transform coefficient level that precedes the current transform coefficient in the coding order / reconstruction order.

[0144] In some embodiments, at the start of inverse quantization of a transform block, state is set equal to 0. The transform coefficients are reconstructed in scan order (ie, in the same order in which they were entropy decoded).

[0145] After reconstructing the current transform coefficients, the state is updated according to the state machine. Fig. 12A In the example, k represents the value of the transform coefficient level. In each state, the next state is determined based on the parity of the transform coefficient level k (i.e., (k&1)). The next state when (k&1)==1 is different from the next state when (k&1)==0. Fig. 12A As shown, the state machine includes two arrows pointing to two different states from each of the four states. Fig. 12B is to show the basis according to some examples Fig. 12A Table of exemplary quantizer selections for state transitions. For example, according to Fig. 12A and Fig. 12B , in state 1, if (k&1) == 0, the next state will be 2, if (k&1) == 1, the next state will be 0.

[0146] Accordingly, at the decoder, the reconstructed quantization index of a transform coefficient can be calculated according to expression (6):

[0147] quantIdx=(abs(k)<<1)-(state&1) (6).

[0148] Where abs() is a function that calculates the absolute value of the input, and state is the current state of the state converter when parsing the level of the current transform coefficient. In addition, at the decoder side, the reconstructed transform coefficient after inverse quantization can be obtained according to expression (7):

[0149] transCoeff=quantIdx·Δ (7).

[0150] Several exemplary deficiencies in current designs of sign prediction schemes are recognized herein. In a first example, sign prediction in current ECMs is applicable only to prediction of signs of transform coefficients in transform blocks to which only a primary transform (e.g., DCT and DST transforms) is applied. As described above, LFNST can be applied to transform coefficients from the primary transform to provide better energy compression of residual samples of intra-coded blocks. However, for transform blocks to which LFNST is applied in current ECM designs, sign prediction is bypassed.

[0151] In a second example, a predetermined maximum number of prediction symbols (denoted as “L max ”) to control the complexity of symbol prediction. In the current ECM, the video encoder determines the maximum number of values ​​(e.g., L) based on the trade-off between complexity and coding efficiency. max =8), and send the value to the video decoder. In addition, for each transform block, the video encoder or decoder may scan all transform coefficients in raster scan order and select the first L max non-zero transform coefficients as candidate transform coefficients for sign prediction. This identical treatment of different transform coefficients in a transform block may not be optimal in terms of the accuracy of the sign prediction. For example, for transform coefficients with relatively relatively large magnitudes, the prediction of their signs is more likely to achieve correct predictions. This is because using incorrect signs for those transform coefficients tends to have a greater impact on the generation of reconstructed samples on block boundaries than by using transform coefficients with relatively small magnitudes.

[0152] In a third example, instead of directly encoding and decoding the explicit symbol value, the video encoder or decoder can encode and decode the correctness of the predicted symbol. For example, for a transform coefficient with a positive sign, if its predicted sign is also positive, it is only necessary to indicate a binary bit "0" in the bitstream from the video encoder to the video decoder. In this case, the predicted symbol is the same as the true sign (or original sign) of the transform coefficient, indicating that the sign prediction of the transform coefficient is correct. Otherwise (for example, if the predicted sign is negative and the true sign is positive), a binary bit "1" can be included in the bitstream from the video encoder to the video decoder. If all symbols are correctly predicted, the corresponding binary bits indicated in the bitstream are zero, which can be effectively entropy encoded by CABAC. If some symbols are incorrectly predicted, the corresponding binary bits indicated in the bitstream are 1. Although arithmetic coding and decoding plus appropriate context models can effectively encode and decode binary bits according to their corresponding probabilities, non-ignorable bits for indicating symbol values ​​are still generated in the bitstream.

[0153] In the fourth example, the spatial discontinuity between the samples at the boundary between the current block and its neighboring blocks is used to select the best symbol prediction combination in the current design of symbol prediction in ECM. The L1 norm of the gradient difference along the vertical and horizontal directions is used to capture the spatial discontinuity. However, since the distribution of image signals is usually uneven, using only the vertical and horizontal directions may not accurately capture the spatial discontinuity.

[0154] In accordance with the present disclosure, a video processing method and system for symbol prediction in block-based video coding and decoding are provided herein to address one or more of the above exemplary deficiencies. The method and system disclosed herein can improve the coding and decoding efficiency of symbol prediction while considering the friendliness of hardware codec implementation. The method and system disclosed herein can improve the coding and decoding efficiency of transform blocks, which applies symbol prediction technology to the transform coefficients of the block.

[0155] For example, as mentioned above, the sign prediction may predict the sign of the transform coefficients in the transform block based on the correlation between the boundary samples (also called side samples) located at or near the boundary of the transform block and its spatial neighboring blocks. Assuming that the existence of the correlation is independent of which specific transform is applied, the two coding tools (i.e., LFNST and sign prediction) do not interfere with each other and can be applied jointly. In addition, because LFNST further compresses the energy of the transform coefficients of the main transform, the sign prediction of the transform coefficients of LFNST should be more accurate than the sign prediction of the main transform. This is because incorrect sign prediction of the transform coefficients from LFNST may generate a larger difference in the smoothness of the boundary samples. Therefore, consistent with the present disclosure, a coordination scheme is disclosed herein to enable the combination of LFNST and sign prediction to enhance the codec efficiency of transform coefficient coding and decoding. In addition, a template-based hypothesis generation scheme is also disclosed herein to reconstruct the boundary samples for different prediction symbol combinations so as to reduce the number of inverse transforms.

[0156] In another example, instead of giving equal treatment to different transform coefficients in a transform block to select candidate transform coefficients for symbol prediction as described above, higher weights may be given to transform coefficients that may cause differences between boundary samples of adjacent blocks, taking into account that the signs of these transform coefficients are easier to predict. Consistent with the present disclosure, the methods and systems disclosed herein may select candidate transform coefficients for symbol prediction (e.g., transform coefficients whose signs are to be predicted for a transform block) based on one or more selection criteria to improve the accuracy of symbol prediction. For example, transform coefficients that have a greater impact on reconstructing boundary samples (rather than transform coefficients that have a smaller impact on reconstructing boundary samples) are selected as candidate transform coefficients for symbol prediction, so that the accuracy of symbol prediction can be improved.

[0157] In yet another example, when the signs of transform coefficients in a transform block are predicted with high accuracy (e.g., the correctness of the predicted symbols is above a threshold such as 80% or 90%), there is a strong correlation between the boundary samples of the transform block and its neighboring blocks. In this case, it often happens that there may be consecutive transform coefficients (e.g., especially for a few non-zero transform coefficients at the beginning of the transform block) that can be correctly predicted for most scenarios. In such scenarios, a single binary bit (rather than multiple binary bits) can be used to indicate whether the signs of all consecutive transform coefficients are correctly predicted to save the signaling overhead of symbol prediction. Consistent with the present disclosure, a vector-based symbol prediction scheme is disclosed herein to reduce the signaling overhead of symbol prediction. Unlike the existing symbol prediction that predicts the sign of each non-zero transform coefficient separately, the disclosed vector-based symbol prediction scheme groups a group of consecutive non-zero candidate transform coefficients and predicts their corresponding symbols together, so that the average number of binary bits (or bits) used to indicate the correctness of the predicted symbol can be effectively reduced.

[0158] In yet another example, using only the vertical and horizontal directions may not accurately capture the spatial discontinuity between samples at the boundary between the current block and its neighboring blocks. Therefore, more directions may be introduced to more accurately capture the spatial discontinuity. Consistent with the present disclosure, an improved cost function is disclosed herein that considers both the gradients in the vertical and horizontal directions and the gradients in the diagonal direction to more accurately capture the spatial discontinuity.

[0159] Fig.13 1 is a block diagram illustrating an exemplary symbol prediction process 1100 in block-based video encoding and decoding according to some embodiments of the present disclosure. In some embodiments, the symbol prediction process 1300 may be performed by the transform processing unit 52. In some embodiments, the symbol prediction process 1300 may be performed by one or more processors (e.g., one or more video processors) of the video encoder 20 or the video decoder 30. Throughout the present disclosure, without loss of generality, LFNST is used as an example of a secondary transform. It is contemplated that other examples of secondary transforms may also be applied herein.

[0160] In existing designs of ECM, symbol prediction is disabled for transform blocks to which LFNST is applied. However, the principle of symbol prediction is to predict the sign of transform coefficients based on the correlation between the boundary samples of the transform block and its spatially neighboring blocks, which does not depend on the specific transform type (e.g., whether it is a primary transform or a secondary transform) or the transform kernel (e.g., whether it is a DCT or a DST) applied to the transform block. Therefore, symbol prediction and LFNST can be applied together to further improve the efficiency of the transform codec herein. Consistent with the present disclosure, the symbol prediction process 1300 can be applied to predict the signs of transform coefficients in a transform block to which the primary transform and the secondary transform are jointly applied.

[0161] An exemplary overview of a symbol prediction process 1300 is provided herein. First, the symbol prediction process 1300 may perform a coefficient generation operation 1302, i.e., applying a primary transform and a secondary transform to a transform block of a video frame from a video to generate transform coefficients for the transform block. Next, the symbol prediction process 1300 may perform a coefficient selection operation 1304, i.e., selecting a set of candidate transform coefficients for symbol prediction from the transform coefficients. Subsequently, the symbol prediction process 1300 may perform a hypothesis generation operation 1306, i.e., applying a template-based hypothesis generation scheme to select a hypothesis from a plurality of candidate hypotheses for a set of candidate transform coefficients. In addition, the symbol prediction process 1300 may perform a symbol generation operation 1108, i.e., determining a symbol candidate combination associated with the selected hypothesis as a set of predicted symbols for a set of candidate transform coefficients. Operations 1302, 1304, 1306, and 1308 are described in more detail below, respectively.

[0162] For example, transform processing unit 52 of video encoder 20 may jointly apply a primary transform and a secondary transform (e.g., as Figure 6 , where the positive main transform 603 and the positive LFNST 604 are applied together) to transform the residual video data into transform coefficients of the transform block. A predetermined number (e.g., L) of non-zero transform coefficients may be selected from the transform coefficients of the transform block as candidate transform coefficients based on one or more selection criteria as described below, where 1≤L≤the maximum number of symbols that can be predicted. Next, by applying a template-based hypothesis generation scheme, a plurality of candidate hypotheses may be generated using different symbol candidate combinations for the L candidate transform coefficients, respectively, which may generate a total of 2 L candidate hypotheses. Each candidate hypothesis may include reconstructed samples on the top boundary and the left boundary of the transform block. Then, a cost function containing combined gradients along the horizontal direction, the vertical direction, and the diagonal direction may be used to calculate the cost of reconstruction for each candidate hypothesis. The candidate hypothesis associated with the minimum cost among the multiple candidate hypotheses may be determined as a hypothesis for predicting the signs of the L candidate transform coefficients. For example, the symbol candidate combination used to generate the candidate hypothesis associated with the minimum cost is used as the predicted symbol of the L candidate transform coefficients.

[0163] First, the symbol prediction process 1300 may perform a coefficient generation operation 1302, where a primary transform (e.g., DCT, DST, etc.) and a secondary transform (e.g., LFNST) may be jointly applied to a transform block to generate transform coefficients of the transform block. For example, the primary transform may be applied to the transform block to generate primary transform coefficients of the transform block. Then, the LFNST may be applied to the transform block to generate LFNST transform coefficients based on the primary transform coefficients.

[0164] The symbol prediction process 1300 may continue to perform a coefficient selection operation 1304, where a set of candidate transform coefficients for symbol prediction may be selected from the transform coefficients of the transform block based on one or more selection criteria. By selecting the candidate transform coefficients, the number of correctly predicted candidate transform coefficients may be maximized, and the accuracy of symbol prediction may be improved.

[0165] In some embodiments, a candidate transform coefficient set may be selected from transform coefficients of a transform block based on magnitudes of the transform coefficients. For example, the candidate transform coefficient set may include one or more transform coefficients having magnitudes greater than the remaining transform coefficients in the transform block.

[0166] Generally, for transform coefficients with larger magnitudes, the predicted signs of these transform coefficients are more likely to be correct. This is because these transform coefficients with larger magnitudes tend to have more impact on the quality of reconstructed samples, and using incorrect signs for these transform coefficients is more likely to generate discontinuities between boundary samples of a transform block and its spatially neighboring blocks. Based on this basic principle, a set of candidate transform coefficients for sign prediction can be selected from the transform coefficients of a transform block based on the magnitudes of the non-zero transform coefficients in the transform block.

[0167] There may be a variety of ways to implement a transform coefficient magnitude-based reordering scheme for sign prediction. In a first embodiment, the scheme may directly use transform coefficients reconstructed after inverse quantization (i.e., inverse quantized transform coefficients) for sorting, so that inverse quantized transform coefficients with larger magnitudes will be placed before transform coefficients with smaller magnitudes for sign prediction. For example, all non-zero transform coefficients in a transform block may be scanned and sorted to form a coefficient list in descending order of their magnitudes. A transform coefficient with the largest magnitude may be selected from the coefficient list and placed as a first candidate transform coefficient in a candidate transform coefficient set, a transform coefficient with a second largest magnitude may be selected from the coefficient list and placed as a second candidate transform coefficient in a candidate transform coefficient set, and so on, until the number of selected candidate transform coefficients reaches a predetermined number L.

[0168] In the second embodiment, instead of directly using the inverse quantized transform coefficients, the quantization index of each transform coefficient (e.g., quantIdx obtained according to expression (6)) can be used to represent the magnitude of the transform coefficient and used for such sorting. As shown in expression (7), since the value of an inverse quantized transform coefficient is equal to the product of its quantization index quantIdx and the corresponding step size Δ, and the step size is the same for the inverse quantization of all transform coefficients in a transform block, the two embodiments are actually mathematically the same. However, assuming that the quantization index quantIdx can be obtained in the parsing stage (which is earlier than the acquisition of the inverse quantized transform coefficient), the second embodiment can provide certain benefits when implemented by some specific hardware.

[0169] In some embodiments, a candidate transform coefficient set may be selected from the transform coefficients of the transform block based on the coefficient scanning order of the entropy codec applied in the video codec. Since natural video content may have rich low-frequency information, the amplitude of the non-zero transform coefficient obtained from the processing of the video content tends to be large at the low-frequency position and smaller towards the high-frequency position. Therefore, a coefficient scanning order (such as zigzag scanning, upper left scanning, horizontal scanning or vertical scanning, etc.) may be used in modern video codecs to scan the transform coefficients in the transform block for entropy coding and decoding. By using this coefficient scanning order, the transform coefficients with larger amplitudes (usually corresponding to lower frequencies) are scanned before the transform coefficients with smaller amplitudes (usually corresponding to higher frequencies). Based on this basic principle, the candidate transform coefficient set for symbol prediction disclosed herein may be selected from the transform coefficients of the transform block based on the coefficient scanning order for entropy coding and decoding. For example, a coefficient list may be obtained by scanning all the transform coefficients in the transform block using the coefficient scanning order. Then, the first L non-zero transform coefficients in the coefficient list may be automatically selected as the candidate transform coefficient set for symbol prediction.

[0170] In some embodiments, for an intra-coded block, a candidate transform coefficient set for symbol prediction may be selected from the transform coefficients of the block based on the intra prediction direction of the block. For example, multiple scan orders consistent with the intra prediction direction (e.g., 67 intra prediction directions in VVC and ECM) may be determined and stored as a lookup table at both the video encoder 20 and the video decoder 30. When encoding and decoding the transform coefficients of the intra block, the video encoder 20 or the video decoder 30 may identify the scan order that is closest to the intra prediction of the intra block from the scan order. The video encoder 20 or the video decoder 30 may use the identified scan order to scan all non-zero transform coefficients of the intra block to obtain a coefficient list, and select the first L non-zero transform coefficients from the coefficient list as the candidate transform coefficient set.

[0171] In some embodiments, the video encoder 20 may determine a scanning order for transform coefficients of a transform block and signal the determined scanning order to the video decoder 30. One or more new syntax elements indicating the determined scanning order may be signaled via the bitstream. For example, multiple fixed scanning orders (e.g., for different transform block sizes and codec modes) may be predetermined by the video encoder 20 and pre-shared with the video decoder 30. Then, after selecting a scanning order from the fixed scanning orders, the video encoder 20 only needs to signal a single index to indicate the selected scanning order to the video decoder 30. In another example, one or more new syntax elements may be used to implement any selected scanning order for signaling transform coefficients. In some embodiments, one or more syntax elements may be signaled at various encoding levels (e.g., sequence parameter set (SPS), picture parameter set (PPS), picture (or slice) level, CTU (or CU) level, etc.).

[0172] In some embodiments, a candidate transform coefficient set may be selected from transform coefficients of a transform block based on an influence score of the transform coefficient on a reconstructed boundary sample of the transform block. Specifically, as shown in the above expression (5), a combination of symbols (i.e., prediction symbols or symbol prediction factors) is selected based on a cost function to minimize the discontinuity of the gradient of samples between the current transform block and its spatial neighboring blocks. Therefore, the signs of transform coefficients having a relatively large influence on the reconstructed samples on the top and left boundaries of the current transform block tend to be more likely to be accurately predicted, because the flipping of these symbols may cause a large change in the smoothness between the boundary samples as calculated in (5). In order to maximize the percentage of accurate symbol prediction, the signs of these transform coefficients (i.e., the transform coefficients having a large influence on the reconstructed boundary samples) may be predicted before other transform coefficients (i.e., the transform coefficients having a small influence on the reconstructed boundary samples). Based on this basic principle, the candidate transform coefficient set for symbol prediction disclosed herein may be selected based on their influence scores on the reconstructed samples on the top and left boundaries of the current transform block.

[0173] For example, the video encoder 20 or the decoder 30 may sort all transform coefficients based on the magnitude of their corresponding influence scores on the reconstructed boundary samples of the transform block. If a transform coefficient has a larger influence score on the reconstructed boundary samples, it may be assigned a smaller index in the symbol prediction candidate list because it is more likely to be correctly predicted. The candidate transform coefficient set disclosed herein may be the L transform coefficients with the L smallest indices in the symbol prediction candidate list.

[0174] In some embodiments, different criteria may be applied to quantify the influence score of the transform coefficient on the reconstruction boundary samples. For example, a value that measures the energy of the change on the reconstruction boundary samples caused by the transform coefficient may be used as the influence score, which may be obtained as follows (in the L1 norm):

[0175]

[0176] In the above expression (6), C i,j T represents the transform coefficient at position (i, j) in the transform block. i,j (l, k) represents the transformation coefficient C i,j The corresponding boundary sample at the position (l, k) of the associated template. N and M represent the width and height of the transform block respectively. V represents the influence score of the transform coefficient at the position (i, j).

[0177] In another example, the L1 norm in the above expression (8) may be replaced by the L2 norm, so that the influence score (e.g., a measure of the energy of the change on the reconstructed boundary samples caused by the transform coefficients) may be calculated using the L2 norm as follows:

[0178]

[0179] Consistent with the present disclosure, although only the top and left boundary samples (e.g., as indicated by T i,j (0, n) and T i,j (m, 0) is used for the calculations in the above expressions (8) and (9), but the transform coefficient selection scheme disclosed in this article can also be applied to any symbol prediction scheme by changing the reconstructed samples of the current transform block used in the corresponding cost function.

[0180] Similar to the scheme based on transform coefficient magnitude, there may be different ways to implement the scheme based on influence fraction. In a first embodiment, the scheme may directly use the dequantized transform coefficient C i,j The magnitude of is as shown in expressions (8) and (9). In the second embodiment, the quantization index value quantIdx may be used instead of the inverse quantized transform coefficient C i,j , to calculate the corresponding cost metric. Specifically, when the quantization index value quantIdx is applied, expressions (8) and (9) become the following expressions (10) and (11):

[0181]

[0182] where quantIdx i,j Represents the quantization index of the transform coefficient at position (i, j) in the transform block.

[0183] Since the value of an inverse quantized transform coefficient is equal to the product of its quantization index quantIdx and the corresponding step size Δ, and the step size is the same for the inverse quantization of all transform coefficients in a transform block, the two methods are actually mathematically identical.

[0184] The symbol prediction process 1300 may continue to perform a hypothesis generation operation 1106, in which a template-based hypothesis generation scheme may be applied to select a hypothesis for a candidate transform coefficient set from a plurality of candidate hypotheses. First, a plurality of symbol candidate combinations for the candidate transform coefficient set may be determined based on the total number of coefficients included in the candidate transform coefficient set. For example, if there are a total of L candidate transform coefficients, the plurality of symbol candidate combinations for the candidate transform coefficient set may be 2 L symbol candidate combinations. Each symbol candidate can be a negative sign (-) or a positive sign (+). Each symbol candidate combination can include a total of L negative signs or positive signs. For example, if L = 2, the multiple symbol candidate combinations can include 2 2 =4 symbol candidate combinations, which are (+,+), (+,-), (-,-) and (-,-).

[0185] Next, a template-based hypothesis generation scheme may be applied to generate multiple candidate hypotheses for multiple symbol candidate combinations, respectively. In order to reduce the complexity of the inverse primary transform and inverse secondary transform that need to be performed, the template-based hypothesis generation scheme disclosed herein may be used to optimize the generation of reconstructed boundary samples of the transform block. Two exemplary methods for implementing the template-based hypothesis generation scheme are disclosed herein. It is contemplated that other exemplary methods for implementing the template-based hypothesis generation scheme are possible, and are not limited thereto.

[0186] In a first exemplary method, a corresponding candidate hypothesis for each symbol candidate combination may be generated based on a linear combination of templates, so that a plurality of candidate hypotheses may be generated for a plurality of symbol candidate combinations, respectively. Each template may correspond to a candidate transform coefficient from a candidate transform coefficient set. Each template may represent a group of reconstructed samples on a top boundary and a left boundary of a transform block. Each template may be generated by applying an inverse secondary transform and an inverse primary transform to the transform block, wherein each candidate transform coefficient in the candidate transform coefficient set is set to zero except for the candidate transform coefficient corresponding to the template which is set to 1 (e.g., the candidate transform coefficient corresponding to the template is set to 1, and each of the remaining candidate transform coefficients is set to 0).

[0187] For example, the corresponding candidate hypothesis for each symbol candidate combination may be set as a linear combination of templates. For a template corresponding to a corresponding candidate transform coefficient, the corresponding weight of the template may be set to the magnitude of the inverse quantized transform coefficient corresponding to the corresponding candidate transform coefficient. An example of hypothesis generation based on a linear combination of templates is shown in FIG. Fig.14, which is described in more detail below.

[0188] To predict the sign of the candidate transform coefficient, the video encoder 20 or the decoder 30 may go through all candidate hypotheses before identifying the hypothesis associated with the sign candidate combination that minimizes the cost value calculated from the cost function. In the first exemplary method described above, each candidate hypothesis may be generated based on a combination of multiple templates, which is relatively complex when considering the per-sample point calculations (e.g., additions, multiplications, and shifts) involved in such a combination. In order to reduce the computational complexity associated with the identification of the hypothesis that minimizes the cost value calculated from the cost function, a second exemplary method is introduced herein.

[0189] In a second exemplary method, multiple symbol candidate combinations associated with multiple candidate hypotheses may be respectively regarded as multiple hypothesis indexes regarding multiple candidate hypotheses. For example, the numbers 0 and 1 may be configured to represent a positive sign (+) and a negative sign (-), respectively. The symbol candidate combination corresponding to the candidate hypothesis may be used as a unique representation (i.e., hypothesis index) regarding the candidate hypothesis. For example, assume that there are three symbols to be predicted (e.g., L=3). Assumption index 000 may represent a candidate hypothesis generated by setting all three symbol candidates to positive (e.g., the three symbol candidates are (+, +, +)). Similarly, assumption index 010 may represent a candidate hypothesis generated by setting the first symbol candidate and the third symbol candidate to positive and the second symbol candidate to negative (e.g., the three symbol candidates are (+, -, +)).

[0190] Then, a plurality of candidate hypotheses may be generated based on a Garry code order of the plurality of hypothesis indices, such that a reconstructed sample of a previous candidate hypothesis having a previous hypothesis index may be used to generate a current candidate hypothesis having a current hypothesis index. In the Garry code order of the plurality of hypothesis indices, the current hypothesis index of the current candidate hypothesis may be immediately after the previous hypothesis index of the previous candidate hypothesis. The current hypothesis index may be generated by changing a sign candidate associated with the previous hypothesis index from positive (or negative) to negative (or positive). For example, the current hypothesis index may be obtained by changing a single "0" (or "1") in the previous hypothesis index to "1" (or "0").

[0191] For example, multiple hypothesis indices may be reordered based on the Galli code order of the multiple hypothesis indices to generate a reordered hypothesis index sequence. For a first hypothesis index in the reordered hypothesis index sequence, a first candidate hypothesis corresponding to the first hypothesis index may be generated by applying an inverse secondary transform and an inverse main transform to a transform block in which each candidate transform coefficient in the candidate transform coefficient set is set to 1. For a second hypothesis index immediately following the first hypothesis index in the reordered hypothesis index sequence, a second candidate hypothesis corresponding to the second hypothesis index may be generated based on (a) a first candidate hypothesis corresponding to the first hypothesis index and (b) an adjustment item regarding the second candidate hypothesis. Table 3 below shows an exemplary process for generating all candidate hypotheses for LFNST when the number of candidate transform coefficients is 3 (e.g., L=3).

[0192] Table 3

[0193]

[0194] In Table 3 above, the first column shows 2 3 =8 symbol candidate combinations. The second column shows the hypothesis indexes corresponding to the symbol candidate combinations by using the numbers 0 and 1 to represent the positive sign (+) and the negative sign (-), respectively. The hypothesis indexes in the second column are sorted according to the Garry code order (for example, in the order of 000, 001, 011, 010, 110, 111, 101, 100). The third column shows the candidate hypotheses corresponding to the symbol candidate combinations and the hypothesis indexes, respectively. The fourth column shows the calculation of the candidate hypotheses, respectively.

[0195] In Table 3, TXYZ in the fourth column represents a corresponding template (i.e., a reconstructed sample point on the top and left boundaries of the transform block), which can be generated by applying an inverse transform to a coefficient matrix of the transform block in which a specific transform coefficient is set to one and all other transform coefficients are equal to zero. For example, T100 represents a corresponding template generated by applying an inverse transform to a coefficient matrix in which only the transform coefficient corresponding to the first symbol candidate is set to one and all transform coefficients in the coefficient matrix are set to zero. C0, C1, and C2 represent the absolute values ​​of the inverse quantized transform coefficients associated with the first symbol candidate, the second symbol candidate, and the third symbol candidate, respectively.

[0196] Referring to Table 3, for a first hypothesis index 000, a first candidate hypothesis H000 is generated by applying an inverse secondary transform and an inverse primary transform to a coefficient matrix associated with a transform block in which each candidate transform coefficient is set to 1. For a second hypothesis index 001 immediately following the first hypothesis index 000, the second candidate hypothesis H001 may be generated based on (a) the first candidate hypothesis H000 and (b) an adjustment item (e.g., -C2*T001) for the second candidate hypothesis. Similarly, for a third hypothesis index 011 immediately following the second hypothesis index 001, a third candidate hypothesis H011 may be generated based on (a) the second candidate hypothesis H001 and (b) an adjustment item (e.g., -C1*T010) for the third candidate hypothesis. For a fourth hypothesis index 010 immediately following the third hypothesis index 011, a fourth candidate hypothesis H010 may be generated based on (a) the third candidate hypothesis H011 and (b) an adjustment item (e.g., C2*T001) for the fourth candidate hypothesis.

[0197] Subsequently, a hypothesis associated with a minimum cost may be determined from a plurality of candidate hypotheses based on a cost function comprising combined gradients in the horizontal, vertical, and diagonal directions. As described above, if the cost function utilizes only gradients in the horizontal and vertical directions (e.g., as shown above in expression (5)), it may not be well suited for very non-uniform image signals. Consistent with the present disclosure, gradients in one or more diagonal directions are also utilized to improve the accuracy of the cost function. For example, two diagonal directions including a left diagonal direction and a right diagonal direction may also be incorporated into the cost function. For example, the cost function for the two diagonal directions may be described according to the following expressions (12) and (13):

[0198]

[0199] In the above expressions (8) or (9), B -1,n-1 , B -2,n-2 , B -1,n+1 and B -2,n+2 represents the neighboring samples of the transform block from the top neighboring block of the transform block. m-1,-1 , C m-2,-2 , C m+1,-1 and C m+2,-2 P represents the neighboring samples of the transform block from the left neighboring block of the transform block. 0,n and P m,0 Denote the reconstructed samples on the top and left boundaries of the transform block, respectively. N and M denote the width and height of the transform block, respectively. costD1 and costD2 denote the left diagonal cost function about the left diagonal direction and the right diagonal cost function about the right diagonal direction, respectively.

[0200] The two cost functions for the diagonal direction (e.g., costD1 and costD2) can be used in conjunction with the cost function of the horizontal-vertical cost function (e.g., costHV shown in the above expression (5)). Then, the cost function for symbol prediction can be determined based on the horizontal-vertical cost function including the gradients in the horizontal and vertical directions, the left diagonal cost function including the gradients in the left diagonal direction, and the right diagonal cost function including the gradients in the right diagonal direction. For example, the cost function can be a weighted sum of the horizontal-vertical cost function, the left diagonal cost function, and the right diagonal cost function as described in expression (14):

[0201] cost=costHV+ω(costD1+costD2)(14).

[0202] In the above expression (14), ω represents the weights with respect to the left diagonal cost function and the right diagonal cost function.

[0203] In another example, the cost function may be the minimum value of the horizontal-vertical cost function, the left diagonal cost function, and the right diagonal cost function as described in Expression (15):

[0204] cost=min{costHV, costD1, costD2}(15).

[0205] Compared with the expression (5) shown above, the cost function in the expression (14) or (15) disclosed in this article may require more neighboring pixels to support the cost functions costD1 and costD2 along the diagonal direction, which will be referred to below. FIG. 16A to FIG. 16B Describe in more detail.

[0206] In some embodiments, the above expression (14) or (15) may be used to determine the corresponding cost of each candidate hypothesis. Then, multiple costs may be calculated for multiple candidate hypotheses respectively. The minimum cost among the multiple costs may be determined. The candidate hypothesis associated with the minimum cost may be determined from the multiple candidate hypotheses and selected as the hypothesis for symbol prediction.

[0207] The symbol prediction process 1300 may continue to perform a symbol generation operation 1108, where a symbol candidate combination associated with the selected hypothesis is determined as a predicted symbol set for the candidate transform coefficient set. For example, the symbol candidate combination (e.g., L symbol candidates) used to generate the selected hypothesis may be used as a predicted symbol for the L candidate transform coefficients.

[0208] In some embodiments, the symbol generation operation 1308 may also include applying a vector-based symbol prediction scheme to the predicted symbol set to generate a symbol signaling bit sequence for the candidate transform coefficient set. A bitstream including the symbol signaling bit sequence may be generated by the video encoder 20 and stored in Figure 1 Alternatively or additionally, the bit stream may be stored in a storage device 32. Figure 1 The link 16 is sent to the video decoder 30.

[0209] As described above, when the signs of the transform coefficients in a transform block are well predicted, there is a high probability that the signs representing multiple consecutive transform coefficients can be correctly predicted. In this case, since the signaling scheme in the existing symbol prediction design needs to signal multiple binary bits "0" to individually indicate the corresponding sign of each transform coefficient that can be correctly predicted, it is obviously inefficient in terms of the overhead for signaling the symbol value of the transform block. Fig.15A An exemplary implementation of an existing symbol prediction scheme is described in more detail.

[0210] Consistent with the present disclosure, the efficiency of symbol signaling can be improved by applying the vector quantity-based symbol prediction scheme disclosed herein. Specifically, the candidate transform coefficients of the transform block can be divided into multiple groups, and the signs of the candidate transform coefficients in each group can be predicted together. In this case, when the original symbols (or true symbols) of the candidate transform coefficients in a group are respectively the same as their predicted symbols, it is only necessary to send a binary bit with a value of "0" in the bitstream to indicate that all symbols in the group are correctly predicted. Otherwise (that is, there is at least a candidate transform coefficient in the group whose original symbol is different from the predicted symbol), a binary bit with a value of "1" can be first signaled in the bitstream to indicate that not all symbols of the candidate transform coefficients in the group are correctly predicted. Then, an additional binary bit can also be signaled in the bitstream from the video encoder 20 to the video decoder 30 to individually notify the corresponding correctness of each predicted symbol in the group. Reference is made to the following. Fig. 15B Exemplary implementations of the vector-based symbol prediction scheme disclosed herein are described in more detail.

[0211] In some embodiments, the candidate transform coefficient set may be divided into a plurality of candidate transform coefficient groups. For each candidate transform coefficient group, one or more symbol signaling bits may be generated for the candidate transform coefficient group to indicate the correctness of the predicted symbol.

[0212] In one example, a symbol signaling bit may be generated based on whether the original symbol of the candidate transform coefficient group is the same as the predicted symbol of the candidate transform coefficient group. In response to the original symbol of the candidate transform coefficient group being the same as the predicted symbol of the candidate transform coefficient group, a binary bit with a value of zero ("0") may be generated and added to the bitstream as a symbol signaling bit. For example, the bitstream may include "0" to indicate that the predicted symbol of the candidate transform coefficient group is correctly predicted.

[0213] On the other hand, in response to the original symbol of the candidate transform coefficient group being different from the predicted symbol of the candidate transform coefficient group, a binary bit with a value of one ("1") may be generated. A set of additional binary bits for notifying the corresponding correctness of the predicted symbol of the candidate transform coefficient group may also be generated. Then, the binary bit with a value of 1 and the set of additional binary bits may be added to the bitstream as symbol signaling bits. For example, the set of additional binary bits may be an XOR result of the original symbol and the predicted symbol of the candidate transform coefficient group. The additional binary bit with a value of "0" may indicate that the predicted symbol of the candidate transform coefficient corresponding to the additional binary bit is correctly predicted, while the additional binary bit with a value of "1" may indicate that the predicted symbol of the candidate transform coefficient corresponding to the additional binary bit is incorrectly predicted. The bitstream may include: (a) "1" to indicate that the predicted symbol of the candidate transform coefficient group is not correctly predicted; and (b) a set of additional binary bits to indicate which predicted symbols are correctly predicted and which predicted symbols are incorrectly predicted.

[0214] Symbol signaling bits may be similarly generated using other context models. For example, the symbol signaling bits may include a "0" to indicate that the predicted symbol for the candidate transform coefficient group is correctly predicted, and a binary bit with a value of one ("1") to indicate that the predicted symbol is incorrect. A set of additional binary bits may also be generated to signal the corresponding correctness of the predicted symbols for the candidate transform coefficient groups with incorrect symbol predictions.

[0215] In some embodiments, the size of each candidate transform coefficient group may be adaptively changed based on one or more predetermined criteria. The one or more predetermined criteria may include the width or height of the transform block, the coding mode of the transform block (e.g., intra-frame or inter-frame coding), and the number of non-zero transform coefficients in the transform block. In some embodiments, the size of each candidate transform coefficient group may be signaled in the bitstream at various coding levels (such as SPS, PPS, slice or picture level, CTU or CU level, or transform block level).

[0216] In some embodiments, one or more constraints may be applied to limit the application scenarios of the vector-based symbol prediction scheme disclosed herein. For example, the vector-based symbol prediction scheme disclosed herein may be applied to process the symbols for the first portion of transform coefficients in a transform block, while the symbols for the second portion of transform coefficients in the transform block may be processed using an existing symbol prediction scheme. In another example, the vector-based symbol prediction scheme disclosed herein may be applicable to the first N (e.g., N=2, 3, 4, 5, 6, 7, or 8, etc.) non-zero candidate transform coefficients from the transform block, while the symbols of the other candidate transform coefficients forming the transform block may be processed using an existing symbol prediction scheme. Fig.15A , which will be described later in this disclosure.

[0217] Consistent with the present disclosure, the symbol prediction process 1100 disclosed herein may be disabled in some scenarios. For example, when LFNST is applied to a coding block encoded by intra template matching mode, the main transform may be DST-VII. Assuming that the LFNST kernel transform in ECM is mainly trained when the main transform is DCT-II, the corresponding LFNST transform coefficients of the intra template matching block may exhibit different characteristics when compared with the LFNST transform coefficients of other LFNST blocks. Based on this principle, when the current coding block is an intra template matching block and is encoded using LFNST, the symbol prediction process 1300 may be disabled.

[0218] Consistent with the present disclosure, the maximum number of prediction symbols for an LFNST block and the maximum number of prediction symbols for a non-LFNST block may be different to control the computational complexity of symbol prediction. For example, the maximum number of prediction symbols for an LFNST block may be set to 6 (or 4), while the maximum number of prediction symbols for a non-LFNST block may have a value different from 6 (or 4). In addition, different values ​​for the maximum number of prediction symbols may be applied to video blocks to which LFNST is applied and to which LFNST is not applied. In some embodiments, the video encoder 20 may determine the maximum number of prediction symbols for an LFNST block based on the corresponding complexity or performance preference of the encoder, and may signal the maximum number to the video decoder 30. When the maximum number of prediction symbols for an LFNST block is signaled to the video decoder 30, it may be signaled at various encoding levels (e.g., sequence parameter set (SPS), picture parameter set (PPS), picture or slice level, or CTU or CU level). In some embodiments, video encoder 20 may determine different values ​​for the maximum number of prediction symbols for video blocks to which LFNST is applied and for video blocks to which LFNST is not applied, and signal the value of the maximum number from video encoder 20 to video decoder 30 .

[0219] Consistent with the present disclosure, assuming that the transform coefficients of both the primary transform and the secondary transform are fixed, the video encoder 20 or the video decoder 30 may pre-compute the template (e.g., samples of the template) for different transform block sizes and different combinations of primary transform and secondary transform combinations. The video encoder 20 or the video decoder 30 may store the template (e.g., samples of the template) in an internal memory or an external memory to avoid the complexity of generating samples of the template on the fly for optimized implementations. The samples of the template may be stored in different fractional precisions to achieve different trade-offs between storage size and sample precision. For example, the video encoder 20 or the video decoder 30 may scale the floating point samples of the template by a fixed factor (e.g., 64, 128, or 256) and round the scaled samples to their nearest integer. The rounded samples may be stored in a memory. Then, when the template is used to reconstruct a candidate hypothesis, its corresponding samples may first be descaled to the original precision to ensure that the samples generated in the candidate hypothesis are within the correct dynamic range.

[0220] Fig.14 is a graphical representation showing exemplary hypothesis generation based on linear combinations of templates according to some embodiments of the present disclosure. Fig.14 In , four pattern blocks 0-3 represent candidate transform coefficients whose signs are to be predicted. Factors C0, C1, C2, and C3 represent corresponding values ​​of the inverse quantized transform coefficients of the four candidate transform coefficients. Templates 0-3 may correspond to the four candidate transform coefficients 0-3, respectively. For example, template 0 corresponding to candidate transform coefficient 0 may be generated by applying an inverse secondary transform and an inverse primary transform to the transform block, wherein candidate transform coefficient 0 is set to 1, and the remaining candidate transform coefficients in the transform block are set to zero. Similarly, templates 1-3 may be generated, respectively. Candidate hypotheses may be generated by adding templates 0-1 to weights C0-C3, respectively.

[0221] Fig.15A is a graphical representation showing an exemplary implementation of an existing symbol prediction scheme according to some examples. Fig. 15B is a graphical representation showing an exemplary implementation of a vector-based symbol prediction scheme according to some embodiments of the present disclosure. Figure 15A-15B An exemplary comparison between existing symbol prediction schemes and the vector-based symbol prediction scheme disclosed herein is illustrated.

[0222] exist Figure 15A-15B In , there are six non-zero transform coefficients in the transform block, which are selected as candidate transform coefficients for sign prediction. The candidate transform coefficients are scanned from the coefficient matrix of the transform block using a raster scan order. The original signs and predicted signs of the candidate transform coefficients are also Figure 15A-15B For example, the original sign and predicted sign of the first candidate transform coefficient with a value of "-2" are both "-" (in Figure 15A-15B The original sign and predicted sign of the second candidate transform coefficient with a value of "3" are both "+" (in Fig.13 A- Fig.13 B). The original sign and predicted sign of the third candidate transform coefficient with a value of "1" are "+" and "-" respectively (in Fig.13 A- Fig.13 B are represented as "0" and "1" respectively). The original sign of the third candidate transform coefficient is incorrectly predicted. Figure 15A-15B As shown, except for the third transform coefficient, the original signs of all other candidate transform coefficients are the same as their corresponding predicted signs (ie, are correctly predicted).

[0223] refer to Fig.15A , a total of 6 binary bits (i.e., 0, 0, 1, 0, 0, and 0) are generated, where each binary bit corresponds to a candidate transform coefficient. The 6 binary bits can be generated by performing an XOR operation between the original symbols and the predicted symbols of the 6 candidate transform coefficients. The 6 binary bits can be used to indicate the corresponding correctness of the 6 predicted symbols. For example, the first binary bit and the second binary bit, both of which have a value of "0", indicate that the predicted symbols of the first candidate transform coefficient and the second candidate transform coefficient are correct. The third binary bit with a value of "1" indicates that the predicted symbol of the third transform coefficient is incorrect. The 6 binary bits can be sent to CABAC for entropy coding and decoding.

[0224] refer to Fig. 15B , the vector-based sign prediction scheme disclosed herein divides the 6 candidate transform coefficients into 3 groups, and each group includes 2 consecutive candidate transform coefficients. Because the signs of the candidate transform coefficients in group #0 and group #2 can be correctly predicted, only two binary bits with values ​​of "0" are generated for these two groups. For group #1, since it includes the third candidate transform coefficient whose sign cannot be correctly predicted, a binary bit with a value of "1" is generated (in Fig. 15B ), and the bit is signaled in the bitstream to indicate that the group includes at least a candidate transform coefficient whose original sign is different from its predicted sign. Subsequently, two additional bits with values ​​of "1" and "0" are generated for the third and fourth coefficients in group #1 to indicate whether their signs can be correctly predicted. Correspondingly, when the vector-based sign prediction scheme disclosed herein is applied, there are a total of 5 bits generated for CABAC, which has a greater effect than that generated by Fig.15A The existing symbol prediction scheme shown in generates fewer binary bits. Therefore, by applying the vector-based symbol prediction scheme disclosed in this article, the signaling overhead can be reduced and the encoding and decoding efficiency of the transform block can be improved.

[0225] Consistent with the present disclosure, although a raster scan order is used to obtain candidate transform coefficients from a coefficient matrix of a transform block, such as Fig. 15B As shown, however, any other scanning order may be used to select candidate transform coefficients for symbol prediction. For example, the candidate transform coefficients may be selected based on one or more selection criteria described above. Similar descriptions are not repeated herein.

[0226] Fig.16A is a graphical representation showing an exemplary calculation of a left diagonal cost function along the left diagonal direction according to some embodiments of the present disclosure. Fig. 16B is a graphical representation showing an exemplary calculation of the right diagonal cost function along the right diagonal direction according to some embodiments of the present disclosure. Compared with the above expression (8) for calculating costHV, the left diagonal cost function costD1 or the right diagonal cost function costD2 shown in the above expression (14) or (15) may require more neighboring pixels to support the calculation of the cost functions costD1, costD2 along the diagonal direction (such as in Figure 16A-16B 1604 and 1606). When these pixels in regions 1602, 1604 and 1606 are unavailable, the nearest filling method can be used to fill these unavailable positions. For example, if B in region 1606 -1,4 If not available, then the closest -1,4 Available pixels B -1,3 For filling B -1,4 The location (e.g., B -1,4 =B -1,3 ). If B in area 1602 -1,-1 (Also denoted as C -1,-1 ), B -1,-2 (C -1,-1 ), B -2,-1 (C -1,-1 ) and B -2,-2 (C -1,-1 ) is not available, several exemplary methods are disclosed herein to fill the unavailable positions.

[0227] In a first exemplary approach, each unavailable position may be filled by weighting its nearest available pixel, as shown below in expressions (16)-(19):

[0228] B -2,-2 =(B -2,0 +C 0,-2 )*0.5 (16)

[0229] B -2,-1 =(2*B -2,0 +C 0,-1 ) / 3 (17)

[0230] B -1,-2 =(B -1,0 +2*C 0,-2 ) / 3 (18)

[0231] B -1,-1 =(B -1,0 +C 0,-1 )*0.5 (19).

[0232] In a second exemplary method, some unavailable locations may be filled with their nearest available pixels, respectively. For example, if B in region 1602 -1,-2 If not available, use C 0,-2 Fill. If B -2,-1 If not available, use B -2,0 However, if B -2,-2 and B -1,-1 If not available, they can be filled with the average value of their two nearest neighboring pixels calculated according to the above expressions (16) and (17).

[0233] In the third exemplary method, only available adjacent reconstruction samples are used to calculate the cost function. In the case where the cost calculation of a boundary sample along the upper boundary / left boundary of the current block involves any unavailable reconstruction samples, they will not be used to calculate the cost in the corresponding direction. Fig. 16B In the above example, it is assumed that the cost calculation of the boundary sample involves at least one unavailable reference sample. 0,0 , P 0,1 and P 1,0 is used to calculate the value of the cost function in the upper right direction, and P 0,2 , P 0,3 , P 2,0 and P 3,0 Will not be used.

[0234] Consistent with the present disclosure, although the left and right diagonals (i.e., Figure 16A-16B The 135° and 45° shown in ) are used for illustrative purposes in the calculation of the cost function shown in the above expression (14) or (15), but it is contemplated that any other metric component (e.g., a continuity metric along one or more arbitrary directions) may be incorporated into the calculation of the cost function for symbol prediction.

[0235] In a fourth embodiment, a sample derivation method based on gradient analysis of texture information in neighboring samples of a current block may be implemented to improve the accuracy of a cost function for symbol prediction. Instead of always using a fixed derivation direction (e.g., vertical derivation for upper neighboring samples and horizontal derivation for horizontal neighboring samples), texture analysis of top neighboring reconstructed samples and left neighboring reconstructed samples of the current block may be performed at both the encoder and the decoder, and the most dominant direction of the gradient of the neighboring samples may be selected to derive boundary samples along the top boundary and the left boundary of the current block.

[0236] For example, Fig.17 1 is a flow chart of a method 1700 for capturing the dominant gradient direction within adjacent reconstructed samples of a current block according to some embodiments of the present disclosure. The method 1700 may be implemented by a video processor associated with the video encoder 20 or the video decoder 30, and may include steps 1702-1712 as described below. Some steps are optional steps for performing the disclosure provided herein. In addition, some steps may be performed simultaneously or in conjunction with Fig.17 The order shown in the figure is different from the order in which it is executed.

[0237] In step 1702, reference samples are selected for the current block for gradient derivation. In some embodiments, the reference samples form a template. For example, Fig.18A is a graphical representation showing exemplary template samples and gradient filter windows in gradient-based selection of sample derivation directions for a cost function according to some embodiments of the present disclosure. Fig.18A As shown in , the templates of N rows and N columns of adjacent reconstructed samples above and to the left of the current block are used as reference samples for gradient derivation. Fig.18A In the example, the template size is equal to 3.

[0238] In step 1704, a gradient histogram (HoG) is initialized. For example, a HoG having a plurality of entries may be generated, wherein each entry of the gradient histogram corresponds to a cumulative magnitude of a gradient in a predetermined angular direction. Each entry may be initialized to zero. For example, Fig.18B is a graphical representation of an exemplary Histogram of Gradients (HoG) in a gradient-based selection of sample point derivation directions for a cost function according to some embodiments of the present disclosure. In practice, different predefined directions may be used in the disclosed gradient analysis scheme. In one embodiment, the same directions as the 65 angular directions defined for conventional intra prediction in VVC / ECM are used.

[0239] In step 1706, the gradient filter window is applied to the reference sample to calculate the corresponding gradient. Fig.18AAs shown, an N×N gradient filter window is applied to each template sample point located at the middle row / column of the template (i.e., the filter window is centered at the sample point position) to calculate its corresponding horizontal gradient G h and the vertical gradient G v .

[0240] In step 1708, the angle (Angle) and amplitude (Amp) of the gradient of each reference sample point are calculated. For example, the gradient of the sample point can be calculated according to expressions (20) and (21):

[0241]

[0242] Amp=|G h |+|G v |(21).

[0243] In step 1710, the angle of the gradient may be converted to one of the predefined directions and the corresponding entry in the HoG may be updated. For example, as shown in FIG18, the magnitude in the HoG of each angle may be updated by increasing the magnitude (Amp) of the sample gradient of each angle. As a result, the magnitude is a cumulative magnitude.

[0244] In step 1712, the entry of the HoG with the largest cumulative magnitude is selected as the direction of the neighboring sample points used to derive the cost function for the current block. For example, as shown in FIG18, the largest entry is circled.

[0245] In the above method, the direction with the largest magnitude is selected as the direction for sample point derivation. This method may not be reliable when there is some noise (e.g., quantization error and / or coding noise caused by other coding modules). To solve such a problem, some conditions can be applied before using the main gradient direction as the derivation direction.

[0246] For example, in one embodiment, the selected main gradient direction may be enabled for sample point derivation for cost function calculation only when there are enough template samples belonging to the selected gradient direction (e.g., the percentage of samples belonging to the selected direction is large enough, such as exceeding a predetermined threshold). Otherwise (e.g., the number of template samples belonging to the selected direction is not large enough), the default derivation (e.g., vertical derivation for upper neighbors and horizontal derivation for left neighbors) is still applied.

[0247] In another embodiment, only when the gradient magnitude associated with the main gradient direction is large enough (for example, the ratio of the magnitude of the selected gradient direction to the sum of the magnitudes of all gradient directions is greater than another predetermined threshold), the selected main gradient direction may be enabled for sample point derivation of cost function calculation. Otherwise (for example, the gradient magnitude of the selected direction is not large), the default derivation is still applied.

[0248] In another embodiment, the above constraints are applied together. That is, only when the number of template samples associated with the selected direction is large enough and the gradient magnitude is large enough, the selected direction is enabled for sample derivation of the current block. Otherwise, the default derivation is still applied.

[0249] In yet another embodiment, when the selected dominant gradient direction is enabled, when predicting a symbol within a block, a direction orthogonal to the selected direction is used for sample derivation in the calculation of the cost function. For example, when the selected direction is 45 degrees, then 135 degrees will be used as the direction for deriving samples along the top and left boundaries of the current block. Similarly, when the selected direction is 135 degrees, then 45 degrees will be used as the direction for deriving samples along the top and left boundaries of the current block.

[0250] In the embodiments disclosed above, symbol prediction is only applicable to predicting the 4×4 sub-block located at the upper left of a transform block (e.g. Figure 7 ) in the prediction signal. In general, this approach is reasonable because most of the energy of a common transform block is usually concentrated in a few transform coefficients at low frequencies. Accordingly, the sign of the transform coefficient at the upper left corner is easier to predict statistically than the transform coefficients at other positions. However, this assumption may not always be correct. For example, for inter blocks with complex motion fields (e.g., sub-block inter modes, where an inter block is divided into multiple sub-blocks and each sub-block may have its own MV), many edges may be generated along the boundaries between different motions in the prediction signals of different motions. In this case, after applying the DCT / DST transform, non-negligible high-frequency transform coefficients will be generated, and these coefficients may stand out in the upper left 4×4 corner. The signs of these high-frequency coefficients cannot be predicted based on the sign prediction design disclosed above.

[0251] In some alternative embodiments, the region of transform coefficients that are input to the positive LFNST and thus later used for sign prediction may be selected from several upper left 4×4 sub-blocks (e.g., Figure 7 ) to further improve the encoding and decoding performance. For example, Fig.19 is a graphical representation showing a sign prediction region for predicting the sign of a transform coefficient according to some examples.

[0252] Specifically, the sign of the upper left A×B area of ​​the current transform block may be selected for prediction, where A and B are calculated according to expression (22):

[0253] A=min(width,TH)

[0254] B = min (height, TH) (22)

[0255] Where width and height are the width and height of the transform block, and TH is the maximum region size for symbol prediction (also referred to as the region size threshold). Manipulating the value of TH can provide different performance and complexity tradeoffs for symbol prediction techniques. Expanding the region for symbol prediction increases the number of transform coefficients for which symbols will be predicted, but this may come at the expense of increased computational complexity due to the increased number of symbol combinations that need to be tested at both the encoder and decoder.

[0256] In some embodiments, different methods may be used to determine the value of TH. In one embodiment, a fixed value (e.g., 8, 16, 32, etc.) may be used for TH in all sequences and encoding and decoding scenarios. Assuming that the region size threshold TH is fixed, the encoder and decoder will use the same value (i.e., no signaling) to determine the corresponding region when locating the transform coefficients for symbol prediction. In another embodiment, the encoder may be given the flexibility to decide the optimal region size threshold according to the specific characteristics of the video sequence and its preferred performance / complexity trade-off, and the corresponding value is signaled from the encoder to the decoder.

[0257] In one exemplary method, the region size threshold may be selected from a set of fixed numbers such that only a fixed number of bits need to be signaled in the bitstream to the decoder to indicate which size is selected. For example, assuming there are four allowed region size thresholds {4, 8, 16, 32}, only two bits need to be signaled to indicate a particular value selected from the set. In another exemplary method, the region size threshold may be adaptively determined for a transform block at the encoder side. Thus, the value of the region size threshold may be an arbitrary number. In this case, a fixed length codeword cannot be used due to its unknown value; instead, a variable length codeword (e.g., an exponential Golomb code, a unary code, etc.) may be applied to indicate the value of the determined region size threshold in the bitstream.

[0258] In addition, when the value of TH is sent in the bitstream, it can be signaled at different levels, for example, in the video parameter set (VPS), sequence parameter set (SPS), picture parameter set (PPS), slice header, and coding block level. When it is signaled at the sequence level (e.g., in the VPS or SPS), it means that all transform blocks in the video sequence will share the same region size threshold. When it is signaled at the picture level / slice level (i.e., in the PPS or slice header), it allows the region size threshold to vary from one picture to another or from one stripe to another, respectively. Similarly, when the value is signaled at the coding block, it provides maximum adaptability of the symbol prediction region, however, more coding bits are consumed because the value must be signaled separately for each individual coding block.

[0259] On the decoder side, the decoder may determine the symbol prediction region based on the size of the transform block and the region size threshold TH. When TH is a fixed value, it may not be signaled in the bitstream, but pre-programmed in the decoder. The decoder may use this pre-programmed fixed value for all sequences and scenes. Otherwise, when TH is not a fixed value but a value determined by the encoder, it will be signaled in the bitstream to the decoder. Therefore, the decoder determines the symbol prediction region based on the size of the transform block and the region size threshold TH that is signaled.

[0260] In some embodiments, the decoder may first determine at which level the region size threshold is signaled. As described above, TH may be signaled at different levels (e.g., VPS, SPS, PPS, slice header, and coding block levels, etc.). Based on the level at which it is signaled, the decoder may determine the scope to which the signaled TH should be applied. For example, when TH is signaled at the VPS or SPS level, the decoder applies it to all transform blocks in the video sequence. When TH is signaled at the PPS or slice header level, the decoder applies it to all transform blocks in the current picture / slice, and a different TH will be read for each different picture / slice. When TH is signaled at the coding block level, the decoder applies a different TH read from the bitstream to each different coding block.

[0261] When the region size threshold is a value adaptively determined for a transform block, the decoder may determine the value of TH based on a codeword signaled in the bitstream. As described above, TH may be signaled using a fixed length codeword when TH is selected from a set of predetermined values, or may be signaled using a variable length codeword when TH is an arbitrary number adaptively determined for a transform block.

[0262] In some embodiments, after determining the TH value to be applied to the current transform block, the decoder may determine the symbol prediction region based on the size of the transform block and the region size threshold TH (e.g., according to expression (22)). Fig.19 As shown in , the width A of the symbol prediction region is determined as the smaller of the width of the transform block and the region size threshold TH, and the height B of the symbol prediction region is determined as the smaller of the height of the transform block and the region size threshold TH.

[0263] As described above, in order to improve the efficiency of symbol prediction, a symbol prediction region to which symbol prediction of transform coefficients is applied can be signaled from the encoder to the decoder. In order to implement this extended symbol prediction region on the decoder side, the decoder must be able to handle all possible extended region sizes that can be selected by the encoder, which may introduce ambiguity when the decoder parses symbols for blocks of various sizes. In order to facilitate the implementation of extended symbol prediction regions, a region-based approach can be used to signal the symbols of a transform block in a specific order.

[0264] Assume that there are N possible region size thresholds TH0, TH1, ..., TH N-1 , which can be signaled from the encoder to the decoder and applied by the decoder to locate transform coefficients for symbol prediction. Consistent with the description above, these region size thresholds can be predetermined values ​​or values ​​adaptively determined by the encoder. TH max is the maximum region size threshold among these possible thresholds, i.e., TH max =max{TH0,TH1,…,TH N-1}. TH cur is the threshold chosen to determine the symbol prediction region and is therefore the value signaled to the decoder, where TH cur ∈{TH0,TH1,…,TH N-1 For simplicity, the following description assumes that the width and height of the current transform block are both greater than TH max That is, applying equation (22), A = B = TH max .

[0265] In some embodiments, in order to signal the symbols of a transform block in a specific order, the transform block is first divided into a plurality of regions, and then the symbols of the transform coefficients associated with the plurality of regions are signaled region by region.

[0266] For example, Fig. 20 is a graphical representation showing a partitioning of a transform block according to some examples, wherein the partitioning is used to implement an exemplary order in which the signs of transform coefficients are signaled from an encoder to a decoder. Fig. 20 As shown, the entire area of ​​the transform block can be divided into three different areas:

[0267] (1) The first region (region #1) contains the region size TH predicted by the signed symbol cur The transform coefficients within the upper left region are limited, that is, 0 <= x <TH cur And 0<=y <TH cur ;

[0268] (2) The second region (region #2) contains transform coefficients between the regions defined by the signed symbol prediction region and the maximum symbol prediction region size, i.e., {TH cur <=x <TH max And 0<=y <TH cur}、{0<=x <TH cur And TH cur <=y <TH max}、{TH cur <=x <TH max And TH cur <=y <TH max};as well as

[0269] (3) The third region (region #3) contains all other transform coefficients in the transform block, i.e., x>TH max or y>TH max ,

[0270] where x and y are the horizontal and vertical coordinates of the transform coefficients in the transform block.

[0271] Fig. 20 The regions obtained after applying the above partitioning / division scheme to one transform block are shown. Region #1 contains transform coefficients whose signs may or may not be predicted, while the signs of the transform coefficients in regions #2 and #3 are completely unpredictable, i.e., they are directly signaled in the bitstream. Fig. 20 Under the segmentation structure, the signs of the transform coefficients in area #3 may be sent using a signal first, followed by the signs of the transform coefficients in area #1, and finally the signs of the transform coefficients in area #2 may be sent using a signal.

[0272] In some embodiments, in order to encode the signs of transform coefficients from different regions, the encoder may apply different scanning orders. Fig.21 is a graphical representation showing various scanning orders for scanning signs of transform coefficients according to some examples. Fig.21 Part (a) shows diagonal scanning, part (b) shows horizontal scanning, and part (c) shows vertical scanning.

[0273] In some embodiments, different scanning orders may be applied to the divided regions of the transform block. Fig. 22 is a diagram showing some examples of Fig. 20 A graphical representation of an implementation of different scanning orders for a partitioned transform block. The signs of the transform coefficients in regions #1 and #2 may be scanned by horizontal scanning, and the signs of the transform coefficients in region #3 may be scanned by diagonal scanning, as shown in FIG. Fig. 22 shown.

[0274] As another example, Fig.23 is a graphical representation showing the partitioning of a transform block according to some examples for implementing another exemplary order of signaling the signs of transform coefficients from an encoder to a decoder. In this example, the transform block is divided into only two regions:

[0275] (1) The first region (region #1) contains the region size TH predicted by the signed symbol cur The transform coefficients within the upper left region are limited, that is, 0 <= x <TH cur And 0<=y <TH cur ;as well as

[0276] (2) The second region (region #2) contains all other transform coefficients in the transform block, i.e., x>TH cur or y>TH cur ,

[0277] where x and y are the horizontal and vertical coordinates of the transform coefficients in the transform block.

[0278] Fig. 22 The regions resulting after applying the above partitioning scheme to one transform block are shown. Region #1 contains transform coefficients whose signs may or may not be predicted, whereas the signs of the transform coefficients in region #2 are completely unpredictable, i.e., they are directly signaled in the bitstream. Fig. 22 Under the segmentation structure, in some embodiments, the signs of the transform coefficients in area #2 are first sent with a signal, and then the signs of the transform coefficients in area #1 are sent with a signal.

[0279] In some embodiments, the encoder may apply different scanning orders to scan the symbols of the transform coefficients belonging to the two regions. Fig.24 is a diagram showing some examples of Fig. 22 1 is a graphical representation of an implementation of different scanning orders for a partitioned transform block. In one example, the encoder may scan the signs of the transform coefficients in region #1 by horizontal scanning and scan the signs of the transform coefficients in region #2 by diagonal scanning, such as Fig.24 shown.

[0280] Despite Fig. 22 and Fig.24 In the example shown, only horizontal scanning and diagonal scanning are applied to scan the signs of the transform coefficients, but a person skilled in the art of modern video coding technology will readily recognize that other combinations of scanning orders can be applied to the disclosed region-based signaling method to signal the signs of a transform block.

[0281] Because on the encoder side, in region-based order (e.g., for Fig. 20 The partitions shown in , region #3, region #1, then region #2) are signaled in the bitstream, so at the decoder side, the encoded data is parsed according to the same order. Before performing symbol prediction and other video decoding steps, the decoder can first use the signaled TH cur (and optionally also using TH max ) to determine the regions and read the data for those corresponding regions. Fig. 20 As an example, the decoder can parse the bitstream to first obtain the signs and coded transform coefficients for region #3, followed by the signs and coded transform coefficients for region #1, and then the signs and coded transform coefficients for region #2. The decoder can then perform sign prediction on the transform coefficients in region #1 (the sign prediction region for the transform block).

[0282] It is expected that the extended symbol prediction region scheme does not interfere with any of the symbol prediction techniques disclosed above, which can be easily adapted and combined with the extended symbol prediction region to provide improved codec performance. As just one specific example, the extended symbol prediction region can be combined with symbol prediction reordering and LFNST symbol prediction.

[0283] In the foregoing description, a context model is used to encode the correctness of the predicted symbol in the symbol signaling bit as an example. Specifically, the difference between each predicted symbol can be encoded, and the corresponding true symbol has "0" (or "1") to indicate that the estimated symbol is the same as (or different from) the true symbol. Consistent with some embodiments of the present disclosure, other context models can be used to entropy encode and decode the correctness of symbol prediction to further improve encoding and decoding efficiency.

[0284] In a first exemplary method, the context of the level value (i.e., amplitude) of the transform coefficient can be used for entropy coding of the correctness of the symbol prediction. This is because a larger amplitude tends to have a higher probability of making a correct prediction. For example, when applying this method, the range of possible amplitude values ​​can be divided into several segments, and different contexts can be assigned to the symbol prediction entropy coding of coefficients in different segments.

[0285] In some embodiments, the range of the amplitude of the transform coefficient is divided into a plurality of amplitude segments, and a context may be assigned to each amplitude segment for entropy encoding of the symbol signaling bits for the transform coefficient belonging to the amplitude segment. Every two consecutive amplitude segments in the plurality of amplitude segments may be separated by a threshold value so that the amplitude segments do not overlap.

[0286] In a specific example, the threshold thres can be used to divide the range of transform coefficient amplitudes into two segments, namely (1, thres) and [thres, +∞]. Through this division, if a transform coefficient belongs to the first segment, a first context is allocated to encode and decode the sign of the transform coefficient. Otherwise, if the transform coefficient falls into the second segment, a second context is allocated to encode and decode the sign of the transform coefficient.

[0287] In various embodiments, the value of the threshold (or multiple values ​​of multiple thresholds) can be determined and specified in different ways. In one exemplary method, the value can be fixed (e.g., 2, 3, ..., etc.) and pre-programmed in both the encoder and the decoder. Therefore, a fixed value is used on both the encoder side and the decoder side without the need to send it with a signal. In another exemplary method, the encoder can be given the freedom to select the best threshold and send the corresponding value to the decoder with a signal.

[0288] As described above, the magnitude of each transform coefficient is used to determine the context for encoding and decoding the sign value of the transform coefficient on the encoder side. Therefore, on the decoder side, the magnitude of each transform coefficient is used accordingly to determine the context in order to decode the sign value of the transform coefficient. Assuming that the transform coefficient can only be obtained after dequantization on the decoder side, this scheme may significantly increase the complexity of parsing the bitstream due to the fact that dequantization needs to be performed at the parsing stage. In order to solve this complexity problem, in one embodiment, the decoder can directly use the level k of the transform coefficient (i.e., the quantized value of the transform coefficient directly parsed from the bitstream without applying dequantization) to determine the context for encoding and decoding the sign of a transform coefficient.

[0289] In another embodiment, instead of directly using the level k parsed from the bitstream, the decoder may use a quantization index (i.e., quantIdx) to determine the context for encoding the sign of a transform coefficient. As described, in VVC / ECM, two scalar quantizers may be applied for quantization / dequantization. The actual quantizer used for a transform coefficient is determined by the parity of the transform coefficient before the current transform coefficient. Therefore, the quantization index of the transform coefficient can be used to determine the context for encoding the sign. As previously described, the quantization index can be calculated from the value of level k based on the conversion state (i.e., state) of the current transform coefficient, for example according to expression (6).

[0290] In various embodiments, all of the above magnitude / level based context modeling methods may be combined with Fig.13The disclosed transform coefficient selection scheme combination is described. For example, this combination can be implemented in two different ways. In one method, the transform coefficients can be reordered, and the magnitude / level of the reordered transform coefficients (i.e., the transform coefficients after the transform coefficients are reordered) can determine the corresponding context applied to encode and decode the signs of the transform coefficients in a transform block. In another method, the transform coefficients are not reordered, and the magnitude / level of the transform coefficients (i.e., the transform coefficients before the transform coefficients are reordered) is used without reordering to determine the context applied to encode and decode the signs of the transform coefficients in the transform block.

[0291] Fig.25A and Fig.25B Two examples of context modeling for transform coefficient sign prediction are shown, respectively implementing the above two schemes. Fig.25A As shown, when the first scheme is applied, the transform coefficients are reordered according to their amplitude / level, for example, in the order of 6, 3, 2, 2, 1, 1, 1 and 1. The amplitude / level of the reordered transform coefficients is used to select the context of the symbol signaling bit included in the bitstream. The benefit of this first scheme is that the corresponding amplitude / level used for context modeling matches the transform coefficient whose symbol is encoded and decoded. When this first scheme is applied, the encoder / decoder needs to reorder the transform coefficients before the symbol is encoded / decoded, which may increase the complexity of bitstream parsing and thus reduce the parsing throughput. Fig.25B An implementation of a second approach that avoids this parsing problem is shown. In this second approach, the magnitude / level of the transform coefficients is used for context determination for encoding the symbol without being reordered. Therefore, there is no need to apply reordering at the parsing stage. That is, the magnitude / level used for context modeling may not be aligned with the symbol.

[0292] In a second method, the context of the scan position of the transform coefficient can be used for entropy coding and decoding of symbol prediction. For example, a single context can be applied to the coding and decoding of the transform coefficients located at the first L positions of a transform block, while another context can be applied to the coding and decoding of the symbols of the coefficients at other positions. In a specific example, the value of L can be set to be equal to 1. Thus, one context is allocated for coding and decoding the sign of the first transform coefficient (i.e., the DC coefficient) of a transform coefficient, and another context is allocated for coding and decoding the signs of all other transform coefficients (i.e., the AC coefficient). Alternatively, all symbol prediction positions in a transform block can be classified into different groups according to their respective importance (or probability of correct prediction), and different contexts can be assigned to each group respectively.

[0293] In a third method, coding related information (such as context of coding mode, block size and component channel information) can be used for symbol prediction coding and decoding. For example, different contexts can be used for inter-frame mode and intra-frame mode. In another example, different context models can be used for different blocks. In yet another example, different contexts can be used for luminance components and chrominance components.

[0294] In a fourth method, the transform type used to determine the transform coefficients can be used as a context for sign prediction. As described above, there are multiple transform kernels, such as MTS and LFNST, that are applied to compress the energy of coefficients in a transform block. Assuming that the transform coefficients generated by different transform kernels may exhibit different statistical characteristics, different contexts may be used to entropy encode the signs of the transform coefficients of different transforms.

[0295] Although the above context modeling schemes are described separately, it is expected that any of them can be used together. In practice, each method can be freely combined with other methods to achieve different context designs.

[0296] Fig.26 26 is a flow chart of an exemplary method 2600 for symbol prediction in block-based video encoding and decoding according to some embodiments of the present disclosure. The method 2600 may be implemented by a video processor associated with the video encoder 20 or the video decoder 30, and may include steps 2602 to 2608 as described below. Some steps are optional steps for performing the disclosure provided herein. In addition, some steps may be performed simultaneously or in conjunction with Fig.26 The order shown in the figure is different from the order in which it is executed.

[0297] In step 2602, a video processor may apply a primary transform and a secondary transform to a transform block of a video frame from a video to generate transform coefficients for the transform block.

[0298] In step 2604, the video processor may select a set of candidate transform coefficients for sign prediction from the transform coefficients.

[0299] In step 2606, the video processor may apply a template-based hypothesis generation scheme to select a hypothesis from a plurality of candidate hypotheses for the candidate set of transform coefficients.

[0300] In step 2608, the video processor may determine the candidate combination of symbols associated with the selected hypothesis as a set of predicted symbols for the candidate set of transform coefficients.

[0301] Consistent with the present disclosure, method 2600 and Fig.26It can be performed on the video encoder side or on the video decoder side. When method 2600 is performed on the video encoder side, it can be regarded as an encoding method for transform coefficient sign prediction on the video encoder side. Symbol signaling bits indicating the correctness of the symbol prediction are then generated and encoded to be included in the bitstream sent to the decoder. When method 2600 is performed on the video decoder side, it can be regarded as a decoding method for transform coefficient sign prediction on the video decoder side. The symbol signaling bits are signaled to the decoder in a bitstream that also contains encoded data on the quantization level of the transform coefficient. The decoder can use the signal signaling bits to correct its signal prediction to estimate the original sign of the received transform coefficient. Refer to the following Fig. 27 and Fig.28 An exemplary encoding method and an exemplary decoding method for transform coefficient sign prediction at the video decoder side are provided, respectively.

[0302] Fig. 27 27 is a flow chart of an exemplary video encoding method 2700 for transform coefficient sign prediction performed by a video encoder according to some embodiments of the present disclosure. The method 2700 may be implemented by a video processor associated with the video encoder 20 and may include steps 2702 to 2716 as described below. Some of the steps may be optional steps for performing the disclosure provided herein. In addition, some steps may be performed simultaneously or in different steps. Fig. 27 Execute in the order shown.

[0303] In step 2702, the video processor may apply a primary transform and a secondary transform to a transform block of a video frame from a video to generate transform coefficients for the transform block. In some embodiments, the secondary transform may be a forward LFNST.

[0304] In step 2704, the video processor may determine a symbol prediction region for performing symbol prediction of transform coefficients based on a region size threshold. In some embodiments, the video processor may select the region size threshold and signal the region size threshold. In some embodiments, the video processor may determine the symbol prediction region in the upper left corner of the transform block according to equation (22).

[0305] In step 2706, the video processor may divide / split the transform block into a plurality of regions including a symbol prediction region and at least one other region. In some embodiments, the transform block may be divided into three regions, including a first region of the symbol prediction region, a second region including a rectangular region having a width and a height equal to a maximum region size threshold and outside the symbol prediction region, and a third region covering a remaining region of the transform block outside the first region and the second region. In some embodiments, the transform block may be divided into two regions, including a first region of the symbol prediction region and a second region covering a remaining region of the transform block outside the first region.

[0306] In step 2708, the video processor may select a set of candidate transform coefficients for sign prediction from the transform coefficients in the sign prediction region.

[0307] In step 2710, the video processor may predict symbols for a candidate transform coefficient set. In some embodiments, the video processor may determine a plurality of symbol candidate combinations for the candidate transform coefficient set based on the total number of candidate transform coefficients in the candidate transform coefficient set. The video processor may then apply a template-based hypothesis generation scheme to generate a plurality of candidate hypotheses for the plurality of symbol candidate combinations, respectively. The video processor may select a hypothesis associated with a minimum cost from the plurality of candidate hypotheses based on a cost function. The video processor may determine the symbol candidate combination associated with the selected hypothesis as a predicted symbol set for the candidate transform coefficient set.

[0308] In step 2712, the video processor may generate a symbol signaling bit sequence for a candidate transform coefficient set based on one or more contexts. Various context models and combinations thereof may be used to encode the correctness of the predicted symbols. In some embodiments, the symbol signaling bit sequence may be generated by applying a vector-based symbol prediction scheme.

[0309] In step 2714, the video processor may encode the signs of the transform coefficients of the plurality of regions using corresponding scan orders. In some embodiments, different scan orders are applied to the plurality of regions. For example, when the transform block is divided into three regions in step 2706, the first region and the second region may be scanned in a horizontal scan order, and the third region may be scanned in a diagonal scan order. As another example, when the transform block is divided into two regions in step 2706, the first region may be scanned in a horizontal scan order, and the second region may be scanned in a diagonal scan order.

[0310] In step 2716, the video processor may generate a bitstream to signal the signs of the transform coefficients associated with the plurality of regions and the symbol signaling bit sequence according to the region-based order. In some embodiments, when the transform block is divided into three regions in step 2706, the signs of the transform coefficients of the third region are first signaled in the bitstream, then the signs of the transform coefficients of the first region are signaled, and finally the signs of the transform coefficients of the second region are signaled. In some embodiments, when the transform block is divided into two regions in step 2706, the signs of the transform coefficients of the second region are first signaled in the bitstream, then the signs of the transform coefficients of the first region are signaled.

[0311] The bitstream generated in step 2716 may be sent to a decoder to reconstruct the transform blocks of the video frame. If a region size threshold is selected by the encoder (in step 2704), it may also be included in the bitstream to be signaled to the decoder.

[0312] Fig.28 28 is a flow chart of an exemplary video decoding method 2800 for transform coefficient sign prediction performed by a video decoder according to some embodiments of the present disclosure. The method 2800 may be implemented by a video processor associated with the video decoder 30 and may include steps 2802 to 2818 as described below. Some steps may be optional steps for performing the disclosure provided herein. In addition, some steps may be performed simultaneously or in conjunction with Fig.28 The order shown in the figure is different from the order in which it is executed.

[0313] In step 2802, a video processor may receive a bitstream including coded data of transform coefficients associated with a plurality of regions of a transform block and a symbol signaling bit sequence. In some embodiments, a bitstream may be used, for example Fig. 27 The video encoding method 2700 generates a bitstream.

[0314] In step 2804, the video processor may determine a symbol prediction region for performing symbol prediction of transform coefficients based on a region size threshold. In some embodiments, the region size threshold may be selected by the encoder and signaled to the decoder in the bitstream. In some embodiments, the video processor may determine the symbol prediction region in the upper left corner of the transform block according to equation (22).

[0315] In step 2806, the video processor may divide / split the transform block into a plurality of regions including a symbol prediction region and at least one other region. In some embodiments, the transform block may be divided into three regions, including a first region of the symbol prediction region, a second region including a rectangular region having a width and a height equal to a maximum region size threshold and outside the symbol prediction region, and a third region covering a remaining region of the transform block outside the first region and the second region. In some embodiments, the transform block may be divided into two regions, including a first region of the symbol prediction region and a second region covering a remaining region of the transform block outside the first region.

[0316] In step 2808, the video processor may parse the bitstream to obtain encoded data of transform coefficients associated with a plurality of regions of the transform block according to a region-based order and a scanning order applied to the plurality of regions. In some embodiments, when the transform block is divided into three regions in step 2806, the sign of the transform coefficient of the third region is first read from the bitstream, then the sign of the transform coefficient of the first region is read, and finally the sign of the transform coefficient of the second region is read. In some embodiments, when the transform block is divided into two regions in step 2806, the sign of the transform coefficient of the second region is first read from the bitstream, then the sign of the transform coefficient of the first region is read.

[0317] Within each region, data is parsed according to a corresponding scanning order applied by the encoder to encode and decode the signs of the transform coefficients. For example, when the transform block is divided into three regions in step 2806, the first region and the second region may be scanned in a horizontal scanning order, and the third region may be scanned in a diagonal scanning order. As another example, when the transform block is divided into two regions in step 2806, the first region may be scanned in a horizontal scanning order, and the second region may be scanned in a diagonal scanning order.

[0318] In step 2810, the video processor may perform inverse quantization on the transform coefficients of the transform block. Figure 3 The inverse quantization unit 86 generates inverse quantized transform coefficients from the quantized transform coefficients. The inverse quantized transform coefficients of the transform block in the video decoder 30 may be equivalent to the transform coefficients of the transform block in the video encoder 20.

[0319] In step 2812, the video processor may select a set of candidate transform coefficients for sign prediction from the inverse quantized transform coefficients associated with the sign prediction region.

[0320] In step 2814, the video processor may predict symbols for the candidate transform coefficient set. In some embodiments, the video processor may determine multiple symbol candidate combinations for the candidate transform coefficient set based on the total number of candidate transform coefficients in the candidate transform coefficient set. The video processor may then apply a template-based hypothesis generation scheme to generate multiple candidate hypotheses for the multiple symbol candidate combinations, respectively. The video processor may select a hypothesis associated with a minimum cost from the multiple candidate hypotheses based on a cost function. The video processor may determine the symbol candidate combination associated with the selected hypothesis as the predicted symbol set for the candidate transform coefficient set.

[0321] In step 2816 , the video processor may estimate original symbols for the candidate transform coefficient set based on the set of prediction symbols and the decoded symbol signaling bit sequence in the bitstream received in step 2802 .

[0322] For example, refer to Fig. 15B , the predicted symbol set may include group #0 with a value of (1,0), group #2 with a value of (1,0), and group #3 with a value of (1,0), where 1 indicates a negative sign and 0 indicates a positive sign. The symbol signaling bit sequence may include a bit "0" for group #0, a bit "1,1,0" for group #2, and a bit "0" for group #3. Since the value of the bit for group #0 is "0", indicating that the predicted symbol of the group with a value of (1,0) is correct (e.g., the predicted symbol is the same as the original symbol), the estimated original symbol for group #0 is determined to be (1,0). Since the value of the first bit in the bits for group #1 is "1", indicating that the predicted symbol of the group (1,0) is incorrect (for example, the predicted symbol is different from the original symbol), the estimated original symbol (1,0) for group #1 is determined to be the XOR result of the predicted symbol of the group (1,0) and the second and third bits "1,0" for group #1 (for example, estimated original symbol = XOR ((1,0), (1,0)) = (0,0)). Since the value of the bit for group #2 is "0", indicating that the predicted symbol of the group with the value (1,0) is correct (for example, the predicted symbol is the same as the original symbol), the estimated original symbol for group #2 is determined to be (1,0). Then, the estimated original symbols for the candidate transform coefficient set are formed by concatenating the estimated original symbols of group #0, group #1 and group #2, respectively, including (1,0,0,0,1,0). As described above, the video encoder may use different context models to encode the accuracy of the prediction symbols, and the accuracy of the prediction symbols is adjusted according to these context models.

[0323] In step 2818, the video processor may update the inverse quantized transform coefficients based on the estimated original signs for the candidate transform coefficient set. For example, the video processor may use the estimated original signs as the true signs of the inverse quantized transform coefficients in the transform block corresponding to the candidate transform coefficient set.

[0324] In some embodiments, after updating the inverse quantized transform coefficients, the video processor may further apply an inverse main transform and an inverse secondary transform to the inverse quantized transform coefficients to generate residual samples in a residual block corresponding to the transform block. The inverse secondary transform corresponds to a secondary transform including LFNST. The inverse main transform corresponds to a main transform including DCT-II, DCT-V, DCT-VIII, DST-I, DST-IV, DST-VII, or an identity transform.

[0325] In some embodiments, a symbol signaling bit sequence for a candidate transform coefficient set is generated by a video encoder by: applying a vector-based symbol prediction scheme to another set of prediction symbols for another candidate transform coefficient set selected at the video encoder side; and generating a bitstream including the symbol signaling bit sequence. The other candidate transform coefficient set is a transform coefficient on the video encoder side that corresponds to the candidate transform coefficient set on the video decoder side.

[0326] In some embodiments, applying a vector-based symbol prediction scheme to another predicted symbol set for another candidate transform coefficient set also includes: dividing the other candidate transform coefficient set into multiple candidate transform coefficient groups; and for each candidate transform coefficient group, based on whether the original symbol of the candidate transform coefficient group is the same as the predicted symbol of the candidate transform coefficient group, generating one or more symbol signaling bits for the candidate transform coefficient group.

[0327] In some embodiments, generating one or more symbol signaling bits for the candidate transform coefficient group includes: in response to the original symbol of the candidate transform coefficient group being the same as the predicted symbol of the candidate transform coefficient group, generating a binary bit with a value of zero; and adding the binary bit as the symbol signaling bit to the bitstream. In some embodiments, generating one or more symbol signaling bits for the candidate transform coefficient group includes: in response to the original symbol of the candidate transform coefficient group being different from the predicted symbol of the candidate transform coefficient group, generating a binary bit with a value of 1; generating a group of additional binary bits for notifying the corresponding correctness of the predicted symbol of the candidate transform coefficient group; and adding the binary bit and the group of additional binary bits as the symbol signaling bits to the bitstream.

[0328] Fig.29A computing environment 2910 coupled to a user interface 2950 according to some embodiments of the present disclosure is shown. The computing environment 2910 may be part of a data processing server. For example, the video processor in the video encoder 20 or video decoder 30 disclosed above may be implemented using the computing environment 2910. The computing environment 2910 includes a processor 2920, a memory 2930, and an input / output (I / O) interface 2940.

[0329] The processor 2920 generally controls the overall operation of the computing environment 2910, such as operations associated with display, data acquisition, data communication, and image processing. The processor 2920 may include one or more processors to execute instructions to perform all or some steps in the above method. In addition, the processor 2920 may include one or more modules that promote interaction between the processor 2920 and other components. The processor 2920 may be a central processing unit (CPU), a microprocessor, a single-chip microcomputer, a graphics processing unit (GPU), etc.

[0330] The memory 2930 is configured to store various types of data to support the operation of the computing environment 2910. The memory 2930 may include predetermined software 2932. Examples of such data include instructions for any application or method operating on the computing environment 2910, video data sets, image data, etc. The memory 2930 may be implemented by using any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0331] The I / O interface 2940 provides an interface between the processor 2920 and peripheral interface modules such as a keyboard, a click wheel, buttons, etc. The buttons may include, but are not limited to, a home button, a start scan button, and a stop scan button. The I / O interface 2940 may be coupled to an encoder and a decoder.

[0332] In some embodiments, a non-transitory computer-readable storage medium is also provided, which includes multiple programs, for example, included in the memory 2930, which can be executed by the processor 2920 in the computing environment 2910 to perform the above method. In one example, the multiple programs can be executed by the processor 2920 in the computing environment 2910 to receive (for example, from Figure 2 The video encoder 20 in the computing environment 2910 receives a bitstream or data stream including encoded video information (e.g., video blocks representing encoded video frames and / or one or more associated syntax elements, etc.), and can also be executed by the processor 2920 in the computing environment 2910 to perform the above-mentioned decoding method according to the received bitstream or data stream. In another example, multiple programs can be executed by the processor 2920 in the computing environment 2910 to perform the above-mentioned encoding method, encode the video information (e.g., video blocks representing video frames and / or one or more associated syntax elements, etc.) into a bitstream or data stream, and can also be executed by the processor 2920 in the computing environment 2910 to send a bitstream or data stream (e.g., to a Figure 3 Optionally, a non-transitory computer-readable storage medium may store therein a bit stream or a data stream, the bit stream or the data stream comprising a video decoder 30 in the encoder (e.g., Figure 2 The video encoder 20 in FIG. 1 generates a video signal for a decoder (eg, Figure 3 The video decoder 30 in the video decoder 30) in decoding the video data (e.g., video blocks representing encoded video frames and / or associated one or more syntax elements, etc.). The non-transitory computer-readable storage medium can be, for example, a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0333] In some embodiments, a computing device is also provided, which includes: one or more processors (e.g., processor 2920); and a non-transitory computer-readable storage medium or memory 2930 storing multiple programs executable by the one or more processors, wherein the one or more processors are configured to perform the above-mentioned method when executing the multiple programs.

[0334] In some embodiments, a computer program product is also provided, which includes, for example, multiple programs in the memory 2930, and the multiple programs can be executed by the processor 2920 in the computing environment 2910 to perform the above method. For example, the computer program product may include a non-transitory computer-readable storage medium.

[0335] In some embodiments, the computing environment 2910 may be implemented using one or more ASICs, DSPs, digital signal processing devices (DSPDs), programmable logic devices (PLDs), FPGAs, GPUs, controllers, microcontrollers, microprocessors, or other electronic components for executing the above methods.

[0336] The description of the present disclosure has been presented for purposes of illustration and is not intended to be exhaustive or limited to the present disclosure. Many modifications, variations, and alternative embodiments will be apparent to one of ordinary skill in the art having the benefit of the teachings presented in the foregoing description and the associated drawings.

[0337] Unless otherwise specifically stated, the order of the steps of the method according to the present disclosure is intended to be illustrative only, and the steps of the method according to the present disclosure are not limited to the order specifically described above, but may be changed according to actual conditions. In addition, at least one step of the method according to the present disclosure may be adjusted, combined or deleted according to actual requirements.

[0338] The examples are chosen and described in order to explain the principles of the present disclosure and to enable other persons skilled in the art to understand the various embodiments of the present disclosure and to best utilize the basic principles and various embodiments with various modifications suitable for the specific use contemplated. Therefore, it should be understood that the scope of the present disclosure is not limited to the specific examples of the disclosed embodiments, and modifications and other embodiments are intended to be included within the scope of the present disclosure.

Claims

1. A video decoding method for sign prediction of transform coefficients, comprising: receiving a bitstream comprising encoded data of transform coefficients of a transform block from a video frame of a video; determining, by a decoder, a plurality of regions in the transform block, wherein the plurality of regions comprises a symbol prediction region for performing the symbol prediction and at least one other region; parsing, by the decoder, the bitstream to obtain signs of the transform coefficients according to a region-based order for signaling signs of the transform coefficients associated with the plurality of regions of the transform block; estimating, by the decoder, original signs for a set of candidate transform coefficients associated with the sign prediction region of the transform block; and Transform coefficients associated with the symbol prediction region are updated based on the estimated original symbols. 2 . The video decoding method according to claim 1 , wherein the plurality of regions in the transform block are determined based on a region size threshold. 3 . The video decoding method according to claim 2 , wherein the sign prediction area is determined as a first area in the upper left corner of the transform block whose width and height are equal to the area size threshold. 4 . The video decoding method according to claim 3 , wherein the at least one other region comprises a second region including a remaining region of the transform block outside the first region. 5 . The video decoding method according to claim 4 , wherein the signs of the transform coefficients in the first area are encoded and decoded according to a first scanning order, and the signs of the transform coefficients in the second area are encoded and decoded according to a second scanning order different from the first scanning order. 6 . The video decoding method of claim 5 , wherein the first scanning order is a horizontal scanning order, and the second scanning order is a diagonal scanning order.

7. The video decoding method of claim 4, wherein parsing the bitstream to obtain the signs of the transform coefficients according to a region-based order for signaling the signs of the transform coefficients associated with the plurality of regions of the transform block further comprises: Signs of the transform coefficients are read from the bitstream according to the region-based order of the second region first and then the first region.

8. The video decoding method according to claim 3, wherein the at least one other region includes a second region, the second region includes a region whose width and height in the upper left corner of the transform block are equal to the maximum region size threshold and is outside the first region, wherein the at least one other region also includes a third region, the third region includes a remaining region of the transform block outside the first region and the second region. 9 . The video decoding method according to claim 8 , wherein signs of transform coefficients in the first region, the second region, and the third region are encoded and decoded according to at least two different scanning orders.

10. The video decoding method according to claim 9, wherein the signs of the transform coefficients in the first area and the second area are encoded and decoded according to a horizontal scanning order, and the signs of the transform coefficients in the third area are encoded and decoded according to a diagonal scanning order.

11. The video decoding method of claim 5, wherein parsing the bitstream to obtain the signs of the transform coefficients according to a region-based order for signaling the signs of the transform coefficients associated with the plurality of regions of the transform block further comprises: The signs of the transform coefficients are read from the bitstream according to the region-based order of the third region first, then the first region, and then the second region.

12. The video decoding method of claim 2, wherein the region size threshold is a fixed value for all transform blocks of the video, wherein the region size threshold is not signaled in the bitstream.

13. The video decoding method according to claim 2, wherein the region size threshold is adaptively determined for the transform block, wherein the region size threshold is signaled in the bitstream.

14. The video decoding method according to claim 13, wherein the region size threshold is signaled at a video parameter set, a sequence parameter set, a picture parameter set or a slice header and a coding block level.

15. The video decoding method of claim 1, wherein the bitstream further comprises a symbol signaling bit sequence, wherein estimating original symbols for a set of candidate transform coefficients associated with the symbol prediction region of the transform block further comprises: predicting a sign for a set of candidate transform coefficients associated with the sign prediction region for the transform block; as well as The original symbols for the set of candidate transform coefficients are estimated based on the predicted set of symbols and the sequence of symbol signaling bits.

16. The video decoding method of claim 15, wherein predicting a sign for a candidate transform coefficient set associated with the sign prediction region of the transform block further comprises: Determining a plurality of symbol candidate combinations for the candidate transform coefficient set based on a total number of candidate transform coefficients in the candidate transform coefficient set; applying a template-based hypothesis generation scheme to generate a plurality of candidate hypotheses for the plurality of symbol candidate combinations, respectively; as well as A hypothesis is selected from the plurality of candidate hypotheses as a set of prediction symbols for the set of candidate transform coefficients.

17. The video decoding method according to claim 1, further comprising: An inverse main transform and an inverse low frequency non-separable transform (LFNST) are applied to the transform coefficients of the transform block to generate residual samples in a residual block of the transform block.

18. A video decoding device, comprising: a memory configured to store a bitstream; as well as A processor is coupled to the memory and is configured to execute the video decoding method for sign prediction of transform coefficients according to any one of claims 1 to 17.

19. A non-transitory computer-readable storage medium storing instructions, which, when executed by a processor, cause the processor to perform the video decoding method for sign prediction of transform coefficients according to any one of claims 1 to 17, The bitstream is stored in the computer-readable storage medium.

20. A non-transitory computer-readable storage medium having a bit stream stored therein, the bit stream comprising coded data of transform coefficients of a transform block, wherein the bit stream can be decoded by a video decoding method for sign prediction of transform coefficients according to any one of claims 1 to 17.

21. A video coding method for sign prediction of transform coefficients, comprising: generating, by an encoder, transform coefficients for transform blocks of a video frame from a video; determining, by the encoder, a plurality of regions in the transform block, wherein the plurality of regions comprises a symbol prediction region for performing the symbol prediction and at least one other region; predicting, by the encoder, signs for a set of candidate transform coefficients associated with the sign prediction region for the transform block; as well as A bitstream is generated by the encoder to signal signs of transform coefficients associated with the plurality of regions of the transform block according to a region-based order.

22. The video encoding method of claim 21, wherein the plurality of regions in the transform block are determined based on a region size threshold.

23. The video encoding method according to claim 22, wherein the sign prediction area is determined as a first area in the upper left corner of the transform block whose width and height are equal to the area size threshold. 24 . The video encoding method according to claim 23 , wherein the at least one other region comprises a second region including a remaining region of the transform block outside the first region.

25. The video encoding method according to claim 24, further comprising: encoding transform coefficients in the first region according to a first scanning order; as well as The transform coefficients in the second region are encoded according to a second scanning order different from the first scanning order.

26. The video encoding method of claim 25, wherein the first scanning order is a horizontal scanning order, and the second scanning order is a diagonal scanning order.

27. The video encoding method of claim 24, wherein signs of transform coefficients associated with the plurality of regions of the transform block are signaled according to the region-based order of the second region first and then the first region.

28. The video encoding method according to claim 23, wherein the at least one other region includes a second region, the second region includes an area in the upper left corner of the transform block whose width and height are equal to the maximum region size threshold and is outside the first region, and the at least one other region also includes a third region, the third region includes the remaining area of ​​the transform block outside the first region and the second region.

29. The video encoding method according to claim 28, further comprising: Signs of transform coefficients in the first region, the second region, and the third region are encoded according to at least two different scanning orders.

30. The video encoding method according to claim 29, wherein the signs of the transform coefficients in the first area and the second area are encoded and decoded according to a horizontal scanning order, and the signs of the transform coefficients in the third area are encoded and decoded according to a diagonal scanning order.

31. The video encoding method of claim 25, wherein signs of transform coefficients associated with the plurality of regions of the transform block are signaled according to the region-based order of the third region first, then the first region, then the second region.

32. The video encoding method of claim 22, wherein the region size threshold is a fixed value for all transform blocks of the video, wherein the region size threshold is not signaled in the bitstream.

33. The video encoding method according to claim 22, further comprising: Adaptively determining the region size threshold for the transform block; as well as The region size threshold is signaled in the bitstream.

34. The video encoding method of claim 33, wherein the region size threshold is signaled at a video parameter set, sequence parameter set, picture parameter set or slice header and coding block level.

35. The video encoding method according to claim 21, further comprising: generating a symbol signaling bit sequence based on predicted symbols for the candidate transform coefficient set; as well as The symbol signaling bit sequence is signaled in the bit stream.

36. The video encoding method of claim 21, wherein predicting a sign for a candidate transform coefficient set associated with the sign prediction region of the transform block further comprises: Determining a plurality of candidate symbol combinations for the candidate transform coefficient set based on a total number of candidate transform coefficients in the candidate transform coefficient set; applying a template-based hypothesis generation scheme to generate a plurality of candidate hypotheses for the plurality of symbol candidate combinations, respectively; as well as A hypothesis is selected from the plurality of candidate hypotheses as a set of prediction symbols for the set of candidate transform coefficients.

37. The video encoding method according to claim 1, further comprising: A main transform and a low frequency non-separable transform LFNST are applied to generate transform coefficients of the transform block.

38. A video encoding apparatus, comprising: A processor configured to perform a video encoding method for sign prediction of transform coefficients according to any one of claims 21 to 37; as well as A memory is coupled to the processor and configured to store the bitstream.

39. A non-transitory computer-readable storage medium having instructions stored therein, which, when executed by a processor, cause the processor to perform the video encoding method for sign prediction of transform coefficients according to any one of claims 21 to 37, The bitstream is stored in the computer-readable storage medium.

40. A non-transitory computer-readable storage medium storing a bit stream generated by the video encoding method for sign prediction of transform coefficients according to any one of claims 21 to 37.

Citation Information

Cited By

  • Encoding method, decoding method, encoder, decoder and storage medium

    WO2026193712A1