Method and apparatus for transform training and coding and decoding
By introducing low-frequency inseparable transformation and reduction in inseparable transformation, combined with multi-transform selection and sub-block transformation, the problems of high computing complexity and large storage requirements in high-resolution video encoding and decoding are solved, and more efficient encoding and decoding performance is achieved.
Patent Information
- Application Number
- CN202380088078.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-12-22
- Filing Date
- 2023-12-21
- Publication Date
- 2025-08-12
AI Technical Summary
The existing video encoding and decoding technology has problems with high computational complexity and memory requirements in high resolution video compression, especially when large-block size transformation and multi-transform selection are applied, it is difficult to effectively reduce the bit rate of the bitstream and maintain the video quality.
Low-frequency non-separable transform (LFNST) and reduced non-separable transform (RST) methods are used, and multi-transform selection (MTS) and sub-block transform (SBT), and optimized transformation matrix is derived through offline training, reducing computational complexity and improving encoding and decoding efficiency.
It effectively reduces the computational complexity and storage requirements during the video encoding and decoding process, while improving the encoding and decoding efficiency and video quality, especially maintaining a low bit rate in high-resolution video compression.
Smart Images

Figure CN120476594A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based upon and claims the benefit of priority from provisional application No. 63 / 434,937, filed on December 22, 2022, the entire disclosure of which is incorporated herein by reference in its entirety for all purposes. Background Art
[0003] Digital video is supported by a variety of 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 transmit digital video data through 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 the video data is transmitted or stored. For example, video codec standards include Versatile Video Codec (VVC), Joint Exploration Test Model (JEM), High Efficiency Video Codec (HEVC / H.265), Advanced Video Codec (AVC / H.264), Moving Picture Experts Group (MPEG) codecs, etc. Video codecs typically use prediction methods (e.g., inter-frame prediction, intra-frame prediction, etc.) that exploit the redundancy inherent in video data. Video codecs are intended to compress video data into a form using a lower rate while avoiding or minimizing the degradation of video quality. Summary of the Invention
[0004] Embodiments of the present disclosure provide transform training and encoding and decoding.
[0005] In a first aspect, some embodiments of the present disclosure provide a method for video decoding, comprising: converting a current block into a current vector by a decoder; determining a transformation matrix from a transformation matrix set based on a block shape of the current block and an intra-frame prediction mode corresponding to the current block by the decoder; and performing an inverse transformation process on the current vector by using the transformation matrix by the decoder.
[0006] In a second aspect, some embodiments of the present disclosure provide a method for video encoding, including: converting a current block into a current vector by an encoder; determining a transformation matrix from a transformation matrix set based on a block shape of the current block and an intra-frame prediction mode corresponding to the current block by the encoder; and performing a transformation process on the current vector by using the transformation matrix.
[0007] In a third aspect, some embodiments of the present disclosure provide an apparatus for video decoding, comprising: one or more processors; and a memory coupled to the one or more processors and configured to store instructions executable by the one or more processors, wherein the one or more processors, when executing the instructions, are configured to perform the method according to the first aspect.
[0008] In a fourth aspect, some embodiments of the present disclosure provide an apparatus for video encoding, comprising: one or more processors; and a memory coupled to the one or more processors and configured to store instructions executable by the one or more processors, wherein the one or more processors, when executing the instructions, are configured to perform the method according to the second aspect.
[0009] In a fifth aspect, some embodiments of the present disclosure provide a non-transitory computer-readable storage medium for storing computer-executable instructions, wherein the computer-executable instructions, when executed by one or more computer processors, cause the one or more computer processors to perform a method according to the first aspect.
[0010] In a sixth aspect, some embodiments of the present disclosure provide a non-transitory computer-readable storage medium for storing computer-executable instructions, wherein the computer-executable instructions, when executed by one or more computer processors, cause the one or more computer processors to perform the method according to the second aspect.
[0011] In a seventh aspect, some embodiments of the present disclosure provide a non-transitory computer-readable storage medium for storing a bitstream to be decoded by the method according to the first aspect.
[0012] In an eighth aspect, some embodiments of the present disclosure provide a non-transitory computer-readable storage medium for storing a bitstream to be decoded by the method according to the second aspect.
[0013] 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
[0014] 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.
[0015] Figure 1 is a block diagram illustrating an exemplary system for encoding and decoding video blocks according to some embodiments of the present disclosure.
[0016] Figure 2 is a block diagram illustrating an exemplary video encoder according to some embodiments of the present disclosure.
[0017] Figure 3A is a block diagram illustrating an exemplary video decoder according to some embodiments of the present disclosure.
[0018] Figure 3B is an illustration of a general block diagram of a video decoder according to some embodiments of the present disclosure.
[0019] Figure 3C is a diagram of a low frequency non-separable transform (LFNST) process according to some embodiments of the present disclosure.
[0020] Figures 4A to 4E is a block diagram illustrating how a frame may be recursively divided into multiple video blocks of different sizes and shapes according to some embodiments of the present disclosure.
[0021] Figure 5 are SBT positions, types, and transformation types according to some examples of the present disclosure.
[0022] Figure 6 is the ROI for LFNST16 according to some examples of the present disclosure.
[0023] Figure 7 is a diagram of ROI for LFNST8 according to some examples of the present disclosure.
[0024] Figure 8 is a flowchart of a KLT for exploring non-local correlations according to some examples of the present disclosure.
[0025] Figure 9 is a diagram of angular intra prediction modes in VVC and ECM according to some examples of the present disclosure.
[0026] Figure 10 is a diagram of a template for transforming block clusters according to some examples of the present disclosure.
[0027] Figure 11 is a diagram of clustering of training data based on prediction patterns and neighboring templates according to some examples of the present disclosure.
[0028] Figure 12A is a diagram of an example of retaining transform coefficients in the upper left area according to some examples of the present disclosure.
[0029] Figure 12B is a diagram of an example of retaining transform coefficients in an upper region according to some examples of the present disclosure.
[0030] Figure 12C is a diagram of an example of retaining transform coefficients in a left region according to some examples of the present disclosure.
[0031] Figure 12D is a diagram of an example of retaining transform coefficients in left and upper regions according to some examples of the present disclosure, where the left and upper regions include both the upper region and the left region.
[0032] Figure 13 is a diagram of block transposition and intra-mode mapping for KLT matrix sharing according to some examples of the present disclosure.
[0033] Figure 14 is a flowchart illustrating a method for video decoding according to some examples of the present disclosure.
[0034] Figure 15 is a flowchart illustrating a method for video encoding according to some examples of the present disclosure.
[0035] Figure 16 is a diagram illustrating a computing environment coupled with a user interface according to some examples of the present disclosure. DETAILED DESCRIPTION
[0036] Reference will now be made in detail to specific embodiments, examples of which are illustrated 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 those skilled in the art that various alternatives may be employed. For example, it will be apparent to those skilled in the art that the subject matter presented herein may be implemented on many types of electronic devices having digital video capabilities.
[0037] It should be noted that the terms "first," "second," and similar terms used in the specification, claims, and drawings of the present disclosure are used to distinguish between objects, rather than to describe any particular order or sequence. It should be understood that, under appropriate conditions, the terms used in this manner are interchangeable, and thus, the embodiments of the present disclosure described herein may also be implemented in an order other than that shown in the drawings or described in the present disclosure.
[0038] Large block size transformation with high frequency zeroing
[0039] In VVC, large block size transforms of up to 64×64 are enabled, which are mainly used for higher resolution video, such as 1080p and 4K sequences. For transform blocks with a size (width or height, or both width and height) equal to 64, the high-frequency transform coefficients are zeroed so that only the lower frequency coefficients are retained. For example, for an M×N transform block, where M is the block width and N is the block height, when M is equal to 64, only the transform coefficients of the 32 columns on the left are retained. Similarly, when N is equal to 64, only the transform coefficients of the top 32 rows are retained. When transform skip mode is used for large blocks, the entire block is used without the need to zero any values. In addition, transform shifts are removed in transform skip mode. VTM also supports a configurable maximum transform size in SPS, which enables the encoder to flexibly select up to 32 length or 64 length transform sizes according to the needs of a specific implementation.
[0040] Multiple Transform Selection (MTS) for kernel transforms
[0041] In addition to the DCT-II already adopted in HEVC, the Multiple Transform Selection (MTS) scheme is also used for residual coding and decoding of both inter-frame and intra-frame coded blocks. It uses multiple selected transforms from DCT8 / DST7. The newly introduced transform matrices are DST-VII and DCT-VIII. Table 1 shows the selected DST / DCT basis functions.
[0042] To maintain the orthogonality of the transform matrices, the transform matrices are more accurately quantized than those in HEVC. To keep the intermediate values of the transformed coefficients within 16 bits, all coefficients will have 10 bits after horizontal and vertical transforms.
[0043]
[0044] Table 1 Transform basis functions of DCT-II / VIII and DSTVII for N-point input
[0045] To control the MTS scheme, separate enable flags are specified at the SPS level for intra and inter, respectively. When MTS is enabled at the SPS, a CU-level flag is signaled to indicate whether MTS is applied. Here, MTS is applied only to luma. MTS signaling is skipped when one of the following conditions applies. The position of the last significant coefficient for the luma TB is less than 1 (i.e., DC only). The last significant coefficient of the luma TB is within the MTS zero region. If the MTS CU flag is equal to zero, DCT2 is applied in both directions. However, if the MTS CU flag is equal to one, two other flags are additionally signaled to indicate the transform type for the horizontal and vertical directions, respectively. The transform and signaling mapping table is shown in Table 2. A unified transform selection for ISP and implicit MTS is used by removing intra mode and block shape dependencies. If the current block is in ISP mode or if the current block is an intra block and both explicit MTS for intra and inter are turned on, only DST7 is used for both horizontal and vertical transform kernels. When transform matrix accuracy is involved, an 8-bit main transform kernel is used. Therefore, all transform cores used in HEVC remain the same, including 4-point DCT-2, 4-point DST-7, 8-point DCT-2, 16-point DCT-2, and 32-point DCT-2. In addition, other transform cores including 64-point DCT-2, 4-point DCT-8, 8-point DST-7, 8-point DCT-8, 16-point DST-7, 16-point DCT-8, 32-point DST-7, and 32-point DCT-8 use 8-bit main transform cores.
[0046]
[0047] Table 2 Transformation and signaling mapping table
[0048] To reduce the complexity of large-size DST-7 and DCT-8, high-frequency transform coefficients are zeroed for DST-7 blocks and DCT-8 blocks with size (width or height, or both) equal to 32. Only coefficients in the 16×16 low-frequency region are retained.
[0049] As in HEVC, block residuals can be coded using transform skip mode. To avoid syntax coding redundancy, the transform skip flag is not signaled when the CU-level MTS_CU_flag is non-zero. Note that when LFNST or MIP is activated for the current CU, the implicit MTS transform is set to DCT2. Furthermore, when MTS is enabled for inter-coded blocks, implicit MTS can still be enabled.
[0050] Low-frequency Non-separable Transform (LFNST)
[0051] In VVC, LFNST is applied between the positive main transform and quantization (on the encoder side) and between the inverse quantization and inverse main transform (on the decoder side), as shown in Figure 4. In LFNST, a 4×4 non-separable transform or an 8×8 non-separable transform is applied according to the block size. For example, 4×4 LFNST is applied to small blocks (i.e., min(width, height) < 8), and 8×8 LFNST is applied to larger blocks (i.e., min(width, height) > 4).
[0052] Using the input as an example, the application of the non-separable transform used in LFNST is described as follows. To apply 4×4 LFNST, first represent the 4×4 input block X as a vector
[0053]
[0054] The non-separable transform is calculated as where indicates the transform coefficient vector, and T is a 16×16 transform matrix. Subsequently, the 16×1 coefficient vector is reorganized into a 4×4 block using the scan order (horizontal, vertical, or diagonal) of the block. Coefficients with smaller indices will be placed in the 4×4 coefficient block together with smaller scan indices.
[0055] Reduced non-separable transformation
[0056] LFNST (Low-Frequency Non-Separable Transform) applies the non-separable transform based on the direct matrix multiplication method, enabling LFNST to be implemented in a single instance without multiple iterations. However, it is necessary to reduce the dimension of the non-separable transform matrix to minimize the computational complexity and the memory space for storing the transform coefficients. Therefore, the reduced non-separable transform (or RST) method is used in LFNST. The main idea of the reduced non-separable transform is to map an N-dimensional vector (for 8×8 NSST, N usually equals 64) to an R-dimensional vector in a different space, where N / R (R < N) is the reduction factor. Thus, instead of an N×N matrix, the RST matrix becomes an R×N matrix as follows:
[0057]
[0058] Where the R rows of the transform are the R basis of the N-dimensional space. The inverse transform matrix for RT is the transpose of its forward transform. For 8×8 LFNST, a reduction factor of 4 is applied, and the 64×64 direct matrix (which is the size of a conventional 8×8 non-separable transform matrix) is reduced to a 16×48 direct matrix. Therefore, a 48×16 inverse RST matrix is used on the decoder side to generate the core (main) transform coefficients in the 8×8 upper left region. When a 16×48 matrix is applied instead of 16×64 with the same transform set configuration, each 16×48 matrix obtains 48 input data from three 4×4 blocks in the upper left 8×8 block (excluding the lower right 4×4 block). With the reduced dimension, the memory usage for storing all LFNST matrices is reduced from 10KB to 8KB with a reasonable performance degradation. To reduce complexity, LFNST is restricted to being applicable only when all coefficients outside the first coefficient subgroup are non-significant. Therefore, when LFNST is applied, all main transform coefficients must be zero. This allows tailoring the LFNST index signaling at the last significant position and thus avoids the additional coefficient scan in current LFNST designs that is required to check for significant coefficients only at certain positions.
[0059] The worst-case handling of LFNST (in terms of per-pixel multiplications) limits the non-separable transforms for 4×4 blocks and 8×8 blocks to 8×16 and 8×48 transforms, respectively. In these cases, when LFNST is applied, the last significant scan position must be less than 8 for other sizes less than 16. For blocks of shape 4×N and N×4 with N≥8, the proposed restriction means that LFNST is now applied only once and only to the top-left 4×4 region. Since all main-only coefficients are zero when LFNST is applied, the number of operations required for the main transform is reduced in this case. From the encoder perspective, the quantization of the coefficients is significantly simplified when testing the LFNST transform. The first 16 coefficients (in scan order) must be quantized to the maximum extent possible with rate-distortion optimization, and the remaining coefficients are forced to zero.
[0060] LFNST transformation selection
[0061] In LFNST, there are a total of 4 transform sets, and each transform set uses 2 inseparable transform matrices (kernels). The mapping from intra prediction mode to transform set is predefined. If one of the three CCLM modes (INTRA_LT_CCLM, INTRA_T_CCLM, or INTRA_L_CCLM) is used for the current block (81 <= predModeIntra <= 83), transform set 0 is selected for the current chroma block. For each transform set, the selected inseparable secondary transform candidate is further specified by an explicitly signaled LFNST index. After the transform coefficients, the index is signaled once in the bitstream per intra CU.
[0062] Intra prediction mode Transform Set Index Intra prediction mode < 0 1 0<=intra prediction mode<=1 0 2<=intra prediction mode<=12 1 13<=intra prediction mode<=23 2 24<=intra prediction mode<=44 3 45<=intra prediction mode<=55 2 56<=intra prediction mode<=80 1 81<=intra prediction mode<=83 0
[0063] Table 3 is the transformation selection table
[0064] LFNST index signaling and interaction with other tools
[0065] Since LFNST is restricted to being applicable only when all coefficients outside the first coefficient subgroup are non-significant, the LFNST index encoding depends on the position of the last significant coefficient. Furthermore, the LFNST index is context-encoded but does not depend on the intra prediction mode, and only the first bin is context-encoded. Furthermore, LFNST is applied to intra CUs in both intra and inter slices, and to both luma and chroma. If dual-tree is enabled, separate LFNST indices for luma and chroma are signaled. For inter slices (dual-tree disabled), a single LFNST index is signaled and used for both luma and chroma.
[0066] Considering that large CUs larger than 64×64 are implicitly partitioned (TU tiling) due to the existing maximum transform size limit (64×64), LFNST index searches can quadruple the data buffer for a certain number of decoding pipeline stages. Therefore, the maximum size allowed for LFNST is limited to 64×64. It should be noted that LFNST is only enabled using DCT2. LFNST index signaling is placed before MTS index signaling.
[0067] Using a scaling matrix for perceptual quantization does not explicitly state that the scaling matrix specified for the master matrix is useful for the LFNST coefficients. Therefore, using a scaling matrix for LFNST coefficients is not allowed. For single-tree partitioning mode, chroma LFNST is not applied.
[0068] LFNST training
[0069] The codec efficiency of LFNST is highly dependent on the design of the LFNST kernel, which is derived through offline training. The training process can be considered as a clustering problem, where each cluster represents a large group of transform coefficient blocks obtained from the actual encoding process, and the "centroid" of each cluster is the optimal inseparable transform for the associated transform coefficient blocks in the same cluster, i.e., the KLT.
[0070] Inspired by the classic k-means clustering method, the training of LFNST is performed in a two-stage iterative manner with an initial state:
[0071] initialization
[0072] For each block of transform coefficients collected from the encoding process, a random label ranging from 0 to 3 is assigned. The low-frequency M×N coefficients are then added as one training data in the cluster associated with the assigned label. For each cluster labeled from 1 to 3, the optimal non-separable transform is derived by solving the eigenvectors of the covariance matrix (e.g., singular value decomposition (SVD)), where the covariance matrix is calculated using the training data in the same cluster. In addition, the identity transform, which indicates that no secondary transform is applied, is assigned as the centroid of the first cluster.
[0073] Iteration
[0074] For each available training data, we use rate-distortion optimization to select the optimal kernel and relabel the training data using the selected kernel. With the updated labels for each training data point, we update each cluster and update the “centroid” (kernel) of the clusters labeled from 1 to 3 accordingly. The identity kernel is always assigned to cluster 0.
[0075] SubblockTransform (SBT)
[0076] In VTM, sub-block transform is introduced for inter-frame predicted CUs. In this transform mode, only a sub-part of the residual block is encoded and decoded for the CU. When an inter-frame predicted CU has cu_cbf equal to 1, cu_sbt_flag can be signaled to indicate whether the entire residual block is encoded and decoded or a sub-part of the residual block is encoded and decoded. In the former case, the inter-frame MTS information is further parsed to determine the transform type of the CU. In the latter case, a part of the residual block is encoded and decoded using the inferred adaptive transform, and the other part of the residual block is set to zero.
[0077] When SBT is used for an inter-coded CU, the SBT type and SBT position information are signaled in the bitstream. There are two SBT types and two SBT positions, as shown in Figure 41. For SBT-V (or SBT-H), the TU width (or height) can be equal to half of the CU width (or height) or 1 / 4 of the CU width (or height), resulting in a 2:2 partition or a 1:3 / 3:1 partition. The 2:2 partition is similar to the binary tree (BT) partition, while the 1:3 / 3:1 partition is similar to the asymmetric binary tree (ABT) partition. In the ABT partition, only small areas contain non-zero residuals. If one dimension of the CU is 8 luminance samples, 1:3 / 3:1 partitioning along the dimension is not allowed. There are up to 8 SBT modes for a CU.
[0078] Position-dependent transform kernel selection is applied to the luma transform blocks in SBT-V and SBT-H (chroma TBs that always use DCT-2). The two positions of SBT-H and SBT-V are associated with different kernel transforms. More specifically, the horizontal transform and vertical transform for each SBT position are specified in Figure 41. For example, the horizontal transform and vertical transform for SBT-V position 0 are DCT-8 and DST-7, respectively. When one side of the residual TU is greater than 32, the transform for both dimensions is set to DCT-2. Therefore, the sub-block transform jointly specifies the TU partitioning, cbf, and horizontal and vertical kernel transform types of the residual block. SBT is not applied to CUs encoded in combined inter-intra mode.
[0079] Transform improvements in ECM
[0080] Maximum transform size and zeroing of transform coefficients. Both the CTU size and the maximum transform size (i.e., all MTS transform kernels) are extended to 256, where the largest intra-coded block can have a size of 128×128. The maximum CTU size is set to 256 for UHD sequences and to 128 otherwise. During the main transform, there is no normalized zeroing operation applied to transform coefficients. However, if LFNST is applied, the main transform coefficients outside the LFNST region are normalized to zero.
[0081] Enhanced MTS for intra-frame encoding and decoding
[0082] In the current VVC design [1], for MTS, only the DST7 transform kernel and the DCT8 transform kernel used for intra and inter coding are utilized. An additional primary transform including DCT5, DST4, DST1, and the identity transform (IDT) is adopted. In addition, the MTS set depends on the TU size and the intra mode information. Sixteen different TU sizes are considered, and for each TU size, five different categories are considered according to the intra mode information. For each category, one, four, or six different transform pairs are considered. The number of intra MTS candidates (between 1, 4, and 6 MTS candidates) is adaptively selected according to the sum of the absolute values of the transform coefficients. The sum is compared with two fixed thresholds to determine the total number of allowed MTS candidates: 1 candidate: sum <= th0; 4 candidates: th0 < sum <= th1; 6 candidates: sum > th1.
[0083] Note that although a total of 80 different categories are considered, some of these different categories often share exactly the same transform set. Therefore, there are 58 (less than 80) unique entries in the resulting LUT.
[0084] For the angular mode, the joint symmetry of the TU shape and the intra prediction is considered. Therefore, the mode i (i > 34) with the TU shape of A×B will be mapped to the same category as the mode j = (68 - i) with the TU shape of B×A. However, for each transform pair, the order of the horizontal transform kernel and the vertical transform kernel is swapped. For example, the 16×4 block with mode 18 (horizontal prediction) and the 4×16 block with mode 50 (vertical prediction) are mapped to the same category. However, the vertical transform kernel and the horizontal transform kernel are swapped. For the wide-angle mode, the closest regular angular 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 mode 80.
[0085] LFNST extension with large core
[0086] The LFNST design in VVC is expanded as follows: the number of LFNST sets (S) and the number of candidates (C) are expanded to S = 35 and C = 3, and the LFNST set (lfnstTrSetIdx) for a given intra mode (predModeIntra) is derived according to the following formula: For predModeIntra < 2, lfnstTrSetIdx is equal to 2. For predModeIntra in [0, 34], lfnstTrSetIdx = predModeIntra. For predModeIntra in [35, 66], lfnstTrSetIdx = 68 - predModeIntra. Three different kernels, LFNST4, LFNST8, and LFNST16, are defined to indicate LFNST kernel sets, which are applied to 4×N / N×4 (N≥4), 8×N / N×8 (N≥8), and M×N (M, N≥16), respectively. The kernel dimensions are specified by the following equation: (LFSNT4, LFNST8*, LFNST16*) = (16×16, 32×64, 32×96). Positive LFNST is applied to the upper left low-frequency region, which is called the region of interest (ROI). When LFNST is applied, the main transform coefficients present in the region outside the ROI are zeroed, which is consistent with the VVC standard.
[0087] exist Figure 6 The ROI for LFNST16 is described in
[15] . It consists of six 4×4 sub-blocks that are contiguous in scan order. Since the number of input samples is 96, the transform matrix for positive LFNST16 can be R×96. In this article, R is chosen to be 32, and accordingly 32 coefficients (two 4×4 sub-blocks) are generated from the positive LFNST16, which are placed in coefficient scan order.
[0088] exist Figure 7 The ROI for LFNST8 is shown in . A positive LFNST8 matrix may be R x 64, and R is chosen to be 32. The generated coefficients are positioned in the same way as for LFNST16.
[0089] The mapping from intra prediction modes to these sets is shown in Table 4.
[0090]
[0091] Table 4 Mapping of intra prediction modes and LFNST set indexes
[0092] Signal Dependent Transform (SDT) in JEM
[0093] Given that there are many similar image patches within and across frames, a signal-dependent transform that exploits this correlation can enhance codec performance through KLT. The trained KLT acts as a transform that aims to compress energy more efficiently.
[0094] Figure 8 The flowchart in describes this idea. For the current coding block indicated by C, first, obtain the upper left template t reconstructed by the coding block b The decoder uses a reference image block R consisting of a coded image block and a prediction block p. This reference image block is then used to search for the N most similar image blocks in the reconstructed area. Finally, a one-dimensional KLT is computed based on these blocks and the prediction block. The decoder is unaware of the set of similar candidate blocks. The prediction block and the reconstructed template are used to guide the search for similar blocks, rather than using the original block. The tool works with various block sizes: 4×4, 8×8, 16×16, and 32×32.
[0095] It is known that the Karhunen-Loéve transform (KLT) is the best transform in terms of energy compression efficiency. By searching on the reconstruction area, the N blocks x that are most similar to the reference image block are obtained. i , i=1,2,…,N. Here, x i =(x i1 ,x i2 ,…,x iD ) T And D indicates the vector dimension which is the transform block size. For example, for a 4×4 coding block, N is 16. Subtract the prediction p from those blocks and obtain the residual block u i , i=1,2,…,N, where Therefore, these residual blocks are used as training samples with zero mean for KLT derivation. These N training samples can be used as U = (u1, u2, ..., u N ) represents a D×N matrix. Consider the covariance matrix Σ given by:
[0096] Σ=UU T (3-4),
[0097] The dimension of the covariance matrix is D×D. The KLT basis is the eigenvector of the covariance matrix. For natural image / video content, we found that choosing the number of candidates N as 100 is sufficient for good performance. The computational complexity for the eigenvalue decomposition is O(D 3 ). For a 4×4 block with D=16, the complexity is O(16 3 ), which is acceptable. For large blocks, the complexity will be very high. For a 32×32 block with D=1024, the time complexity will be 262144 times slower than that of a 4×4 block, which is intolerable in the codec framework.
[0098] With this in mind, a fast algorithm is used to make KLT feasible for large block sizes. The dimension of Σ is D×D. However, U T U has a much lower dimension, such as N × N. We calculate Σ′ = U T The eigenvector φ of U satisfies the following equation:
[0099] U T Uφ=φΛ (3-5),
[0100] Where φ represents the eigenvector matrix and Λ represents the diagonal matrix with eigenvalues as diagonal elements. Let us multiply both sides of equation (33) by U to obtain:
[0101] UU T Uφ=UφΛ (3-6),
[0102] Add brackets to this equation and get:
[0103] (UU T )(Uφ)=(Uφ)Λ (3-7).
[0104] The column vector of Uφ is UU T The eigenvectors of , whose corresponding eigenvalues are the diagonal elements of the matrix Λ. Let
[0105] This indicates that the covariance matrix U can be obtained by dividing U with the covariance matrix U from the low dimensional T The high-dimensional covariance matrix U is obtained by multiplying the eigenvector φ obtained by U T The eigenvector of U. The dimensions of and Λ are both D×N. T All other (DN) eigenvectors of have zero eigenvectors. We can use the Schmidt orthogonalization method to fill the (DN) eigenvectors to obtain a D×D eigenvector matrix. To reduce the complexity of matrix multiplication, the KLT transform can be performed using the obtained N eigenvectors, leaving the remaining (DN) transform coefficients as zero. This will not degrade performance because the first N projections can cover most of the signal energy while training the basis from samples that are highly correlated with the coding block.
[0106] In JEM, the described KLT is implemented at the block level on the coding blocks. To be highly adaptable to image / video content, the proposed scheme supports the proposed KLT on 4×4 coding blocks, 8×8 coding blocks, 16×16 coding blocks, and 32×32 coding blocks. On the JEM encoder side, rate-distortion optimization is used to determine the transform mode between SDT and adaptive multiple transform (AMT).
[0107] Extended intra prediction with wide-angle intra mode
[0108] Similar to HEVC, VVC uses a set of reference samples adjacent to the current CU (i.e., above or to the left of the current CU) to predict the samples of the current CU. However, in order to capture the finer edge directions present in natural videos (especially for high-resolution (e.g., 4K) video content), the number of angular intra modes is expanded from 33 in HEVC to 93 in VVC. Figure 9 FIG shows the intra mode defined in VVC and ECM. Figure 9 As shown, among the 93 angle intra modes, modes 2 to 66 are normal angle intra modes, and modes -1 to -14 and modes 67 to 80 are wide angle intra modes. In addition to the angle intra mode, the planar mode ( Figure 1 Mode 0) and DC mode ( Figure 9 Mode 1) in is also applied in VVC.
[0109] Since the quad / binary / ternary tree partitioning structure is applied in VVC, in addition to square-shaped video blocks, there are also rectangular video blocks for intra prediction in VVC. Since the width and height of a given video block are not equal, various angle intra mode sets can be selected from 93 angle intra modes for different block shapes. More specifically, for both square video blocks and rectangular video blocks, in addition to the planar mode and DC mode, 65 of the 93 angle intra modes are supported for each block shape. When the rectangular block shape of the video block meets a certain condition, the video decoder 30 can adaptively determine the index of the wide-angle intra mode of the video block based on the index of the conventional angle intra mode received from the video encoder 20 using the mapping relationship shown in Table 1 below. That is, for non-square blocks, the wide-angle intra mode is signaled by the video encoder 20 using the index of the normal angle intra mode, wherein the index is mapped to the index of the wide-angle intra mode by the video decoder 30 after being parsed, thereby ensuring that the total number of intra modes (i.e., planar mode, DC mode, and 65 of the 93 angle intra modes) (i.e., 67) remains unchanged and the intra mode encoding method remains unchanged. Therefore, good efficiency in signaling intra modes is achieved while providing a consistent design across different block sizes.
[0110] Table 1 shows the mapping relationship between the index of the normal angle intra mode and the index of the wide angle intra mode for intra prediction of different block shapes in VCC, where W represents the width of the video block and H represents the height of the video block.
[0111] Table 1
[0112]
[0113] Figure 1 FIG. 1 is 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 cloud servers, server computers, desktop or laptop computers, tablet computers, smartphones, 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.
[0114] In some embodiments, target device 14 may receive the encoded video data to be decoded via link 16. Link 16 may include any type of communication medium or device capable of moving the encoded video data from source device 12 to target device 14. In one example, link 16 may include a communication medium that enables source device 12 to send the encoded video data directly to 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 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 part 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 source device 12 to target device 14.
[0115] In some other embodiments, the encoded video data may be sent from output interface 22 to storage device 32. The encoded video data in storage device 32 may then be accessed by target device 14 via input interface 28. Storage device 32 may include any of a variety of distributed or locally accessible 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), flash memory, volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data. In another example, storage device 32 may correspond to a file server or another intermediate storage device that can store the encoded video data generated by source device 12. Target device 14 may access the stored video data from storage device 32 via streaming or downloading. A file server may be any type of computer capable of storing and sending encoded video data to 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. Target device 14 may access the encoded video data via any standard data connection suitable for accessing encoded video data stored on a 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 a combination of both. The transmission of the encoded video data from storage device 32 may be a streaming transmission, a download transmission, or a combination of both.
[0116] like Figure 1 As shown in , source device 12 includes a video source 18, a video encoder 20, and an output interface 22. Video source 18 may include a source such as a video capture device (e.g., a video camera), a video archive containing previously captured video, a video feed interface for receiving video from a video content provider, and / or a computer graphics system for generating computer graphics data as source video, or a combination of such sources. As an example, if video source 18 is a camera of a security monitoring system, source device 12 and target device 14 may form a camera phone or video phone. However, the embodiments described in this application are generally applicable to video encoding and decoding, and may be applied to wireless and / or wired applications.
[0117] Captured, pre-captured, or computer-generated video may be encoded by video encoder 20. The encoded video data may be sent directly to target device 14 via output interface 22 of source device 12. The encoded video data may also (or alternatively) be stored on storage device 32 for later access by target device 14 or other devices for decoding and / or playback. Output interface 22 may also include a modem and / or a transmitter.
[0118] Target device 14 includes an input interface 28, a video decoder 30, and a 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 within the encoded video data transmitted over a communication medium, stored on a storage medium, or stored on a file server.
[0119] In some embodiments, the target device 14 may include a display device 34, which may be an integrated display device or 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.
[0120] The video encoder 20 and the video decoder 30 may operate according to proprietary standards or industry standards (e.g., VVC, HEVC, MPEG-4, Part 10, AVC) or extensions of such standards. It should be understood that the present application 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 can be configured to encode video data according to any of these current or future standards. Similarly, it is also generally believed that the video decoder 30 of the target device 14 can be configured to decode video data according to any of these current or future standards.
[0121] 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 (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), 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 encoder or decoder may be integrated as part of a combined encoder / decoder (CODEC) in the corresponding device.
[0122] In some embodiments, at least a portion of the components of source device 12 (e.g., video source 18, video encoder 20, or a component included in video encoder 20 as described below) Figure 23 and the output interface 22) and / or at least a portion of the components of the target device 14 (e.g., the input interface 28, the video decoder 30 or the components included in the video decoder 30 as described below with reference to FIG. 3, and the display device 34) may be run in a cloud computing service network that provides software, platforms, and / or infrastructure, such as software as a service (SaaS), platform as a service (PaaS), or infrastructure as a service (IaaS). In some embodiments, one or more components of the source device 12 and / or the target device 14 that are not included in the cloud computing service network may be set in one or more client devices, and the one or more client devices may communicate with a server computer in the cloud computing service network via a wireless communication network (e.g., a cellular communication network, a short-range wireless communication network, or a global navigation satellite system (GNSS) communication network) or a wired communication network (e.g., a local area network (LAN) communication network or a power line communication (PLC) network). In an embodiment, at least a portion of the operations described herein may be implemented as a cloud-based service provided by one or more server computers in a cloud computing service network, wherein the one or more server computers are implemented by at least a portion of the components of the source device 12 and / or at least a portion of the components of the target device 14; one or more other operations described herein may be implemented by one or more client devices. In some embodiments, the cloud computing service network may be a private cloud, a public cloud, or a hybrid cloud. Terms such as "cloud," "cloud computing," "cloud-based," etc. herein may be used interchangeably without departing from the scope of the present disclosure. It should be understood that the present disclosure is not limited to implementation in the above-mentioned cloud computing service network. Alternatively, the present disclosure may also be implemented in any other type of computing environment currently known or developed in the future.
[0123] Figure 2 is a block diagram illustrating an exemplary video encoder 20 according to some embodiments described herein. Video encoder 20 can perform intra-frame prediction and inter-frame prediction coding of video blocks within video frames. Intra-frame prediction coding relies on spatial prediction to reduce or remove spatial redundancy in video data within a given video frame or picture. Inter-frame prediction coding 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" can be used as a synonym for the term "image" or "picture" in the field of video coding and decoding.
[0124] like Figure 2As shown in FIG, the video encoder 20 includes a video data memory 40, a prediction processing unit 41, a 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 partitioning unit 45, an intra-frame prediction processing unit 46, and an intra-frame 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 block boundaries to remove blocking artifacts from the reconstructed video. In addition to using a deblocking filter, another loop filter, such as a sample adaptive offset (SAO) filter, a cross component sample adaptive offset (CCSAO) filter, and / or an adaptive in-loop filter (ALF), may be used to filter the output of the adder 62. It should be noted that, with respect to the CCSAO technique, the present application is not limited to the embodiments described herein. Instead, the present application may be applied to the following situations: for any one of the luma component, the Cb chroma component, and the Cr chroma component, an offset is selected based on any other of the luma component, the Cb chroma component, and the Cr chroma component to modify the component based on the selected offset. In addition, it should be noted that the first component mentioned herein may be any one of the luma component, the Cb chroma component, and the Cr chroma component, the second component mentioned herein may be any other of the luma component, the Cb chroma component, and the Cr chroma component, and the third component mentioned herein may be the remaining one of the luma component, the Cb chroma component, and the Cr chroma component. In some embodiments, 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.
[0125] 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 1The video data memory 40 is 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 the video data. The video data memory 40 and the DPB 64 can be formed by any of a variety of memory devices. In various examples, the video data memory 40 can be on-chip with the other components of the video encoder 20, or off-chip relative to those components.
[0126] like Figure 2 As 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 slices, tiles (e.g., a set of video blocks), or other larger coding units (CUs) according to a predefined partitioning structure associated with the video data, such as a quad-tree (QT) structure. A video frame is or can be considered to be a two-dimensional array or matrix of samples having 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.
[0127] A video block is also or can be considered to be a two-dimensional array or matrix of samples having sample values, but the size of a video block is smaller than a 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 can be further divided into one or more block partitions or sub-blocks (which can again form blocks) by, for example, iteratively using QT partitioning, binary-tree (BT) partitioning, or triple-tree (TT) partitioning, or any combination thereof. It should be noted that the term "block" or "video block" as used herein can be a portion of a frame or picture, particularly a rectangular (square or non-square) portion. With reference to, for example, HEVC and VVC, a block or a 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) and / or correspond to a subblock.
[0128] Prediction processing unit 41 may select one of a plurality of possible prediction coding modes for the current video block based on the error results (e.g., bit rate and distortion level), such as one of one or more inter-frame prediction coding modes from a plurality of intra-frame prediction coding modes. Prediction processing unit 41 may provide the resulting intra-frame prediction coding block (e.g., prediction block) or inter-frame prediction coding block to adder 50 to generate a residual block and to adder 62 to reconstruct the coding block for subsequent use as part of a reference frame. Prediction processing unit 41 also provides syntax elements (such as motion vectors, intra-frame mode indicators, partition information, and other such syntax information) to entropy coding unit 56.
[0129] 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, e.g., to select an appropriate coding mode for each block of video data.
[0130] In some embodiments, motion estimation unit 42 determines the inter-prediction mode for the current video frame by generating a motion vector according to a predetermined pattern within a sequence of video frames, where the motion vector indicates the displacement of a video block within the current video frame relative to a prediction block within a reference video frame. Motion estimation performed by motion estimation unit 42 is the process of generating a motion vector that estimates motion for a video block.
[0131] 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 relative to the current block being encoded in the current frame. A predetermined pattern may designate video frames in a sequence as P-frames or B-frames. Intra BC unit 48 may determine vectors (e.g., block vectors) for intra BC coding in a manner similar to the determination of motion vectors for inter prediction by motion estimation unit 42, or may utilize motion estimation unit 42 to determine block vectors.
[0132] In terms of pixel differences, the prediction block of a 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 differences may be determined by sum of absolute differences (SAD), sum of square differences (SSD), or other difference metrics. In some embodiments, video encoder 20 may calculate values for sub-integer pixel positions of the reference frame stored in DPB 64. For example, video encoder 20 may interpolate values for quarter-pixel positions, eighth-pixel positions, or other fractional pixel positions of the reference frame. Thus, motion estimation unit 42 may perform motion searches relative to full-pixel positions and fractional pixel positions and output motion vectors with fractional pixel precision.
[0133] 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.
[0134] Motion compensation performed by motion compensation unit 44 may involve extracting or generating a prediction block based on the motion vector determined by motion estimation unit 42. Upon receiving the motion vector for the current video block, motion compensation unit 44 may locate the prediction block pointed to by the motion vector in one of the reference frame lists, retrieve the prediction block from DPB 64, and forward the prediction block to adder 50. Adder 50 then forms a residual video block of pixel difference values by subtracting pixel values of the prediction block provided by motion compensation unit 44 from the pixel values of the current video block being encoded.
[0135] The pixel difference values forming the residual video block may include luma component differences or chroma component differences, or both. Motion compensation unit 44 may also generate syntax elements associated with the video block of the video frame for use by video decoder 30 when decoding the video block of the video frame. The syntax elements may include, for example, syntax elements defining a motion vector for identifying the prediction block, any flags indicating a prediction mode, or any other syntax information described herein. Note that motion estimation unit 42 and motion compensation unit 44 may be highly integrated, but are shown separately for conceptual purposes.
[0136] In some embodiments, intra BC unit 48 may generate vectors and extract prediction blocks in a manner similar to that described above in conjunction with motion estimation unit 42 and 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, intra BC unit 48 may determine the intra prediction mode to be used to encode the current block. In some examples, intra BC unit 48 may encode the current block using various intra prediction modes, for example, during different encoding passes, and test their performance using rate-distortion analysis. Intra BC unit 48 may then select an appropriate intra prediction mode to use from among the various tested intra prediction modes and generate an intra mode indicator accordingly. For example, 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 appropriate intra prediction mode to use.
[0137] Rate-distortion analysis generally determines the amount of distortion (or error) between a coded block and the original, uncoded block that was coded 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 distortion and rate for various coded blocks to determine which intra-prediction mode exhibits the best rate-distortion value for the block.
[0138] 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.
[0139] 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, 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 video block. The pixel difference values forming the residual video block may include both luma component differences and chroma component differences.
[0140] As an alternative to the inter-frame prediction performed by motion estimation unit 42 and motion compensation unit 44 or the intra-frame block copy prediction performed by intra BC unit 48 as described above, intra-frame prediction processing unit 46 may perform intra-frame prediction on the current video block. Specifically, intra-frame prediction processing unit 46 may determine an intra-frame prediction mode to use for encoding the current block. To do so, 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 intra-frame prediction processing unit 46 (or in some examples, mode selection unit) may select an appropriate intra-frame prediction mode to use from the tested intra-frame prediction modes. Intra-frame prediction processing unit 46 may provide information indicating the intra-frame prediction mode selected for the block to entropy encoding unit 56. Entropy encoding unit 56 may encode the information indicating the selected intra-frame prediction mode into the bitstream.
[0141] After prediction processing unit 41 determines a prediction block for the current video block via inter-frame prediction or intra-frame prediction, adder 50 forms a residual video 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 transform processing unit 52. Transform processing unit 52 transforms the residual video data into residual transform coefficients using a transform (such as a discrete cosine transform (DCT) or a conceptually similar transform).
[0142] 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 comprising the quantized transform coefficients. Optionally, entropy encoding unit 56 may perform the scan.
[0143] After quantization, entropy coding unit 56 entropy encodes 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) coding, 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 Storage device 32 is shown for later transmission to or retrieval by video decoder 30. Entropy encoding unit 56 may also entropy encode motion vectors and other syntax elements for the current video frame being encoded.
[0144] Inverse quantization unit 58 and inverse transform processing unit 60 apply inverse quantization and inverse transform, respectively, to reconstruct the residual video block in the pixel domain for use in generating a reference block for predicting other video blocks. 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.
[0145] 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 by intra BC unit 48, motion estimation unit 42, and motion compensation unit 44 as a prediction block to inter-predict another video block in a subsequent video frame.
[0146] Figure 3A 3 is a block diagram illustrating 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-mentioned operations in combination with the above-mentioned operations. Figure 2The decoding process is essentially the reciprocal of the encoding 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. Figure 3B is a block diagram showing a general video decoder for AVS3.
[0147] In some examples, units of video decoder 30 may be tasked with performing embodiments of the present disclosure. Furthermore, in some examples, embodiments of the present disclosure may be dispersed across one or more of the multiple units of video decoder 30. For example, intra BC unit 85 may perform embodiments of the present disclosure alone or in combination with other units of video decoder 30, such as motion compensation unit 82, intra prediction unit 84, and entropy decoding unit 80. In some examples, video decoder 30 may not include intra BC unit 85, and the functionality of intra BC unit 85 may be performed by other components of prediction processing unit 81, such as motion compensation unit 82.
[0148] 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 the 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 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 3A or Figure 3B 92 as two distinct 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 by separate memory devices. In some examples, video data memory 79 may be on-chip with the other components of video decoder 30, or off-chip relative to those components.
[0149] During the decoding process, the video decoder 30 receives an encoded video bitstream representing video blocks of an encoded video frame and associated syntax elements. The video decoder 30 may receive syntax elements at the video frame level and / or the video block level. The entropy decoding unit 80 of the video decoder 30 entropy decodes the bitstream to generate quantization coefficients, motion vectors or intra-frame prediction mode indicators, and other syntax elements. The entropy decoding unit 80 then forwards the motion vectors or intra-frame prediction mode indicators and other syntax elements to the prediction processing unit 81.
[0150] When a video frame is encoded as an intra-frame prediction coded (I) frame or for intra-frame coded prediction blocks in other types of frames, intra-frame 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-frame prediction mode and reference data from a previously decoded block of the current frame.
[0151] When the video frame is encoded as an inter-frame prediction coded (i.e., B or P) frame, motion compensation unit 82 of prediction processing unit 81 generates one or more prediction blocks for a video block of the current video frame based on the motion vectors and other syntax elements received from entropy decoding unit 80. Each of the prediction blocks may be generated from a reference frame in one of the reference frame lists. Video decoder 30 may construct the reference frame lists, List 0 and List 1, using a default construction technique based on the reference frames stored in DPB 92.
[0152] 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 as the current video block, as defined by video encoder 20.
[0153] The motion compensation unit 82 and / or the intra BC unit 85 determine prediction information for a video block of the current video frame by parsing the motion vectors and other syntax elements, and then uses 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 a prediction mode (e.g., intra prediction or inter prediction) for decoding the video block of the video frame, an inter-prediction frame type (e.g., B or P), construction information for one or more of the reference frame lists for the frame, a motion vector for each inter-prediction-encoded video block of the frame, an 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.
[0154] Similarly, the intra BC unit 85 may use some of the received syntax elements, such as a flag that determines whether the current video block is predicted using intra BC mode, construction information of which video blocks of the frame are within the reconstruction area 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 block in the current video frame.
[0155] Motion compensation unit 82 may also perform interpolation using interpolation filters, as used during encoding of the video block by video encoder 20, to calculate interpolated values for sub-integer pixels of a reference block. 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 block.
[0156] Inverse quantization unit 86 inverse quantizes the quantized transform coefficients provided in the bitstream and entropy decoded by entropy decoding unit 80, using the same quantization parameters that were 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.
[0157] 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. A loop filter 91 (such as a deblocking filter, an SAO filter, a CCSAO 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 block in a given frame is 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 the display device 34).
[0158] In a typical video encoding and decoding process, a video sequence typically consists of 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 consist of only a two-dimensional array of luma samples. Figure 3C FIG. 4 is a schematic diagram of an LFNST process according to an example of the present disclosure.
[0159] 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 sequentially ordered 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 of one of 128×128, 64×64, 32×32, and 16×16. However, it should be noted that the present application is not necessarily limited to a particular size.
[0160] like 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 the 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 the samples of the coding tree block. The coding tree block may be an N×N sample block.
[0161] To achieve better performance, the 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 FIG, a 64×64 CTU 400 is first divided into four smaller CUs, each having a block size of 32×32. Among the four smaller CUs, CU 410 and CU 420 are each divided into four CUs with a block size of 16×16. The two 16×16 CUs 430 and CU 440 are each further divided into four CUs with a block size of 8×8.
[0162] Figure 4D Depicted is a diagram showing Figure 4CThe quadtree data structure is the final result of the partitioning process of the CTU 400 depicted in FIG. , with each leaf node of the quadtree corresponding to a CU of each size ranging from 32×32 to 8×8. Figure 4B Each 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-4D The quadtree partitioning depicted in is for illustrative purposes only, and one CTU may be divided into CUs based on quadtree / ternarytree / binarytree partitioning to adapt to varying local characteristics.
[0163] In the multi-type tree structure, a CTU is divided into a quadtree structure, and each quadtree leaf CU can be further divided into a binary tree structure and a ternary tree structure. Figure 4E As shown, there are five possible partition types for a coding block with a width of W and a height of H, namely, quadruple partition, horizontal binary partition, vertical binary partition, horizontal ternary partition, and vertical ternary partition.
[0164] In some embodiments, the video encoder 20 may further divide the coding block of the CU into one or more M×NPBs. A PB is a rectangular (square or non-square) block of samples to which the same prediction (inter or intra) is applied. The PU of a CU may include a PB of luma samples, two corresponding PBs of chroma samples, and syntax elements for predicting the PBs. In a monochrome picture or a picture with three separate color planes, a PU may include a single PB and a syntax structure for predicting the PBs. 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.
[0165] 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 the 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.
[0166] 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, such 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, such 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.
[0167] 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 is a rectangular (square or non-square) block of samples 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.
[0168] Video encoder 20 may apply one or more transforms to the luma transform block of a TU to generate a luma coefficient block for the TU. A coefficient block may be a two-dimensional array of transform coefficients. A transform coefficient may be a scalar. Video encoder 20 may apply one or more transforms to the Cb transform block of a TU to generate a Cb coefficient block for the TU. Video encoder 20 may apply one or more transforms to the Cr transform block of a TU to generate a Cr coefficient block for the TU.
[0169] 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 the process by 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 entropy 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 comprising a sequence of bits forming a representation of an encoded frame and associated data, which is stored in storage device 32 or sent to target device 14.
[0170] 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 the coefficient blocks associated with the TUs of the current CU to reconstruct the residual blocks associated with the TUs of the current CU. The video decoder 30 also reconstructs the coding blocks of the current CU by adding samples of the prediction blocks for the PUs of the current CU to corresponding samples of the transform blocks of the TUs of the current CU. After reconstructing the coding blocks for each CU of the frame, the video decoder 30 may reconstruct the frame.
[0171] As mentioned above, video codecs primarily use two modes: intra-frame prediction (or intra prediction) and inter-frame prediction (or inter prediction) to achieve video compression. It should be noted that IBC can be considered intra prediction or a third mode. Between the two modes, inter prediction contributes more to codec efficiency than intra prediction because motion vectors are used to predict the current video block from a reference video block.
[0172] However, with the continuous improvement of video data capture technology and the more refined video block size 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 spatially neighboring CUs and / or temporally co-located CUs, which is also called the "Motion Vector Predictor (MVP)" of the current CU.
[0173] Instead of combining as above Figure 2 The actual motion vector of the current CU determined by the motion estimation unit 42 is encoded into the video bitstream, and the motion vector predictor 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.
[0174] 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 need to adopt a set of rules for constructing a motion vector candidate list (also called a "merge list") of 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 of 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 in the motion vector candidate list is sufficient for the video encoder 20 and the video decoder 30 to use the same motion vector predictor in the motion vector candidate list to encode and decode the current CU.
[0175] In terms of both transform kernels and signaling methods, transforms in VVC and ECM are more efficiently designed than those in HEVC. Over the past decade, more methods have been proposed to further improve transform codec performance, including MTS, LFNST, and SDT. However, these methods still have several shortcomings.
[0176] In current VVC and ECM, the main transform kernel is derived from the DCT formula and the DST formula. However, the derived transform kernel may not be suitable for all video content with different characteristics. Therefore, there is still a need to research more efficient transform kernels.
[0177] In current VVC and ECM, the transformation matrix in LFNST is actually a trained KLT. However, LFNST is only applied to the secondary transform. The KLT in the primary transform is not considered.
[0178] The signal-dependent transform (SDT) in JEM can achieve significant codec gains. However, the KLT matrix in SDT needs to be derived online at both the encoder and decoder sides through template matching. The complexity of template matching and eigenvalue decomposition is unacceptable, especially for the decoder.
[0179] In order to train KLT, training data must first be collected. In SDT (online KLT training), training data is collected by template matching at both the encoder and decoder sides, which is too complicated. In LFNST, all transform blocks with different block sizes are first collected, and then these blocks are divided into K groups using a clustering method. A KLT matrix is then derived for each group. In video encoding and decoding, an index is signaled for each CU to indicate which transform matrix to use, that is, which group the current transform block belongs to. This method may have two disadvantages. First, training data classification is to divide the training data into different groups to ensure that the training samples in a group meet the same statistical characteristics. However, the training data classification in LFNST may not be accurate enough. Secondly, the index signaled at the CU level also brings additional overhead bits.
[0180] In current VVC and ECM, the transformation kernel is fixed and cannot adapt to the non-stationary characteristics of video content.
[0181] In current video codec standards, forward and inverse transforms share the same transformation matrix to ensure perfect reconstruction. However, due to the quantization of transform coefficients, perfect reconstruction cannot be guaranteed, and transform matrix sharing may not bring optimal compression performance.
[0182] In current VVC and ECM, a secondary transform called LFNST is applied to transform blocks to which MST is not applied, i.e. DCT-II is applied to both horizontal and vertical transforms. However, for transform blocks coded with MTS, LFNST is ignored.
[0183] In order to solve the above-mentioned problems of KLT in video coding and decoding, several methods are proposed to improve the performance of KLT in video coding and decoding: (i) the present disclosure proposes an offline training KLT method for the main transform; (ii) in order to improve the performance of the trained KLT, a more efficient transform block (including training data) classification method is proposed; (iii) for different video statistical features, a KLT matrix adaptive signaling method is also proposed; (iv) in order to deal with the quantization effect of the transform coefficients, an asymmetric KLT is proposed, in which the forward transform and the inverse transform can use different transform matrices; and (v) in the present disclosure, it is proposed to enable LFNST for MTS.
[0184] In this section, we first briefly introduce KLT and then propose KLT training and signaling methods.
[0185] Introduction to KLT
[0186] KLT is an orthogonal transform based on the statistical properties of the signal, which can achieve the optimal transformation gain in terms of mean square error (MSE) metric. Let the input vector be x and the output vector of KLT be X. The correlation between any two elements in X is zero, that is,
[0187]
[0188] Equation (4) is further transformed into the following form:
[0189]
[0190] If we assume that the input vector x is a zero-mean variable, then Equation (5) is transformed into:
[0191] E[X[u1]X[u2]]=0 (5-3)
[0192] In this disclosure, the KLT matrix is denoted as K, and the transformation can be described as follows:
[0193] X=Kx (5-4)
[0194] The covariance matrix of X can be described as:
[0195] E[XX T ]=E[Kxx T K T ]=KE[xx T ]K T =KCK T (5-5)
[0196] Where C is the covariance matrix of the input vector. To ensure that E[X[u1]X[u2]]=0, E[XX T ] must be a diagonal matrix. In other words, the matrix K must transform the matrix C into a diagonal matrix. In other words, the row vectors of the matrix K are the eigenvectors of the matrix C.
[0197] KLT training
[0198] In order to derive the KLT of a signal, the statistical properties, i.e., the covariance matrix of the signal, should be known. However, in practice, it is difficult to obtain the covariance matrix of the signal because the probability distribution is not available. Therefore, in practical applications, KLT derivation is usually based on training from data. There are several problems in training-based KLT derivation. The first problem is how to derive the corresponding KLT matrix given a training set. The second problem is how to collect training samples and classify them into different groups, in which the training samples share the same statistical distribution.
[0199] KLT training method
[0200] In the present disclosure, KLT can be trained using singular value decomposition (SVD) or eigenvalue decomposition given the training data. First, assume that we have collected a training dataset with zero mean for KLT, which consists of N blocks x i (i=1,2,…,N), where x i =(x i1 ,…,x iD ) T And D represents the dimension of the vector, which is just the transform block size. The training samples are normalized to Then, we use these residual blocks as training samples with zero mean for deriving KLT. These N training samples can be used as U = (u1, ..., u N ) is a D×N matrix. We denote the covariance matrix Σ of those training blocks as:
[0201] Σ=UU T (5-6)
[0202] The dimension of Σ is D × D. The relationship between the covariance matrix and its eigenvectors is:
[0203] ΣΨ=ΨΛ (5-7)
[0204] Where Ψ is the transformation matrix, where the column vectors are the eigenvectors (KLT basis), and Λ is a diagonal matrix where the diagonal elements are the eigenvalues. The eigenvectors can be obtained by performing eigenvalue decomposition, or SVD, on the covariance matrix. Note that we have sorted the eigenvalues along with the eigenvectors in descending order of eigenvalue. This is to ensure that the energies of the transform coefficients are in descending order corresponding to the training samples.
[0205] Training data clustering
[0206] In the proposed KLT training method, the samples are transformed blocks obtained from the encoding process. These samples are then clustered into different groups, and each KLT matrix is derived for each group.
[0207] In an embodiment, the training samples are clustered based on the transformed block size. That is, for each block size, a KLT matrix is derived.
[0208] In an embodiment, for intra prediction, training samples are clustered based on transform block size and intra mode. That is, for each transform block size, a set of KLT matrices is derived, where one intra mode corresponds to one KLT matrix or several intra modes share one KLT matrix.
[0209] In an embodiment, for inter prediction, training samples are clustered based on transform block size and AMVR mode. That is, for each transform block size, a set of KLT matrices is derived, where one AMVR mode corresponds to one KLT matrix.
[0210] In an embodiment, for inter prediction, the training samples are clustered based on the transform block size and the absolute value of the motion vector (MV). Several thresholds th1, th2, ..., th M To classify motion vectors. That is, for each transform block size, a set of KLT matrices is derived, where one absolute value range of the motion vector corresponds to one KLT matrix. Here, the motion vector used for classification is the maximum value of the horizontal MV and vertical MV values for both unidirectional prediction and bidirectional prediction.
[0211] In the embodiment, for inter-frame prediction, the training samples are clustered based on the transform block size, prediction mode and neighboring template. It should be noted that for intra-frame prediction, the prediction mode here refers to the intra-frame direction. For inter-frame prediction, the prediction mode refers to the AMVR mode or motion vector value or inter-frame prediction direction, etc. Figure 10 An example template for a specific transform block size used in this embodiment is shown, which consists of N rows and N columns of reconstructed pixels.
[0212] The training process is as follows. In the training set for each transform block size and prediction mode, the neighboring templates are divided into K clusters using classic k-means clustering based on a specific distance metric (including but not limited to the sum of squared errors (SSE) and sum of absolute errors (SAD)). Then, for each transform block size and prediction mode, K template centers are derived and fixed at both the encoder and decoder, as Figure 11 For each (transform block size, prediction mode, template center), a training set is obtained and the corresponding KLT matrix is derived.
[0213] During encoding and decoding, for each transform block, a KLT transform set is first selected based on its block size and prediction mode. The distances between the template of the current block and the K template centers are then calculated. The template center that results in the minimum distance is selected, and the corresponding KLT matrix is applied to the current transform block.
[0214] This embodiment extends the method proposed in Example 4. In Example 4, a KLT matrix is derived for each (transform block size, prediction mode, template center). In this embodiment, for each (transform block size, prediction mode, template center), the training set is further divided into several groups using classic k-means clustering as LFNST. During encoding and decoding, for each (transform block size, prediction mode, template center) pair, a transform matrix set is selected, and an index is used to further indicate which transform matrix in the transform matrix set is used for the current block.
[0215] QP-dependent primary transform
[0216] In this disclosure, we propose a QP-dependent primary transform. In current VVC, ECM, and KLT transform methods, the primary transform is QP-independent, meaning that blocks with different QPs share the same transform matrix. In this disclosure, we propose using different KLT transforms for different QPs. The KLT training process is described as follows. First, training data is collected using different QPs from the encoding process. Second, for each QP, the KLT matrix is derived using the corresponding training set using the method described above.
[0217] During the encoding and decoding process, for each transform block, in addition to using the transform block size, prediction mode and neighboring templates, the encoder or decoder also uses its QP value to select the corresponding transform matrix.
[0218] KLT for wide-angle intra mode
[0219] In the present disclosure, different KLT matrices are trained for different intra prediction modes, that is, a KLT matrix set is trained for each intra prediction mode or intra prediction mode set. Here, the intra prediction mode set may include more than one intra prediction mode. As mentioned above, in VVC and ECM, the wide-angle intra prediction mode is used for rectangular blocks. Therefore, in the present disclosure, KLT for wide-angle intra mode is considered. In one embodiment, only non-wide-angle intra mode is used for KLT, that is, 67 KLT matrices are trained for each block size, where each KLT matrix corresponds to an intra prediction mode ranging from 0 to 66. If the intra mode of a block is a wide-angle mode, the corresponding KLT matrix is selected using the corresponding non-wide-angle intra mode.
[0220] In one embodiment, both Wide Intra mode and non-Wide Intra mode are used for KLT, i.e., each KLT matrix is trained for Intra modes ranging from -14 to 80. Therefore, if a block is encoded using Wide Intra mode, the corresponding KLT matrix is identified and used for both forward and inverse KLT.
[0221] Asymmetric KLT
[0222] In conventional KLT, the main transform and inverse transform share the same transformation matrix to ensure complete signal reconstruction. However, in video / image codecs, the transform coefficients are quantized using a specific quantization parameter (QP) after the transform. Therefore, the original signal cannot be fully reconstructed. To solve this problem, an asymmetric KLT is proposed in this disclosure, in which different transformation matrices can be used for the forward transform and the inverse transform.
[0223] In a first embodiment, transform units of the same size but encoded using different QPs share the same positive KLT matrix, but use different inverse KLT matrices. An example method for deriving the positive KLT matrix and the inverse KLT matrix is described as follows: (i) in a first step, for each TU size, the KLT matrix is derived for all QP values according to the method described above. In this step, the derived positive KLT matrix and the inverse KLT matrix share the same parameters; (ii) in a second step, the KLT matrix derived in the first step is integrated into the video encoder, and information of TUs using KLT is collected as training data used in the following steps, including QP values, original residuals, and quantized transform blocks; and (iii) in a third step, the inverse KLT matrix is refined for each QP value or QP value range. The original residual and quantized transform block for a specific QP value or QP value range are represented as {r1, r2, …, r N}and The refinement of the inverse KLT matrix InvT can be described as follows.
[0224]
[0225] In a second embodiment, transform units with the same size but coded with different QPs share the same inverse KLT matrix, but use different forward KLT matrices.
[0226] In a third embodiment, transform units with the same size may use separate pairs of positive KLT matrices and inverse KLT matrices for different QPs, where the positive matrix and the inverse matrix in each pair may have different matrix elements.
[0227] According to one or more embodiments of the asymmetric KLT, for each TU size, several QP thresholds may be set: QP1, QP2, ..., QP K These QP thresholds divide the QP values into K+1 ranges, and for each QP range, a set of positive KLT matrices / inverse KLT matrices are derived and applied.
[0228] KLT signaling in video encoding and decoding
[0229] In the present disclosure, some embodiments regarding KLT signaling are proposed as follows.
[0230] In a first embodiment, a high-level on / off control of applying KLT is proposed. A flag is signaled in the SPS or PPS or slice header to indicate whether KLT is applied to a sequence or picture or slice.
[0231] In a second embodiment, the use of KLT as an additional transform candidate for MTS is proposed. First, the MTS CU flag is signaled to indicate whether MTS is used for the current CU. If the MTS CU flag is true, the KLT CU flag is signaled to indicate whether KLT is used as the primary transform for the CU. If the MTS CU flag is true and the KLT CU flag is false, the transform pair in the current VVC or ECM is utilized. If more than one KLT matrix is used for a CU, the KLT index should be further signaled.
[0232] In the third embodiment, it is proposed to replace DCT2 and LFNST with KLT. First, the MTS CU flag is signaled to indicate whether MTS is used for the current CU. If the MTS CU flag is false, KLT is applied to the CU, otherwise MTS is applied.
[0233] In a fourth embodiment, it is proposed to replace DCT2 (and LFNST) with MTS. If only one KLT is enabled for a CU, the KLT is applied directly to the CU. If more than one KLT is enabled for a CU, a KLT index is signaled to indicate which KLT matrix to apply. In a fifth embodiment, it is proposed to apply the KLT as LFNST, a secondary transform of MTS. If the MTS CU flag is true, the LFNST flag is signaled. If both the MTS CU flag and the LFNST flag are true and more than one LFNST is enabled for the CU, a LFNST index is signaled to indicate which KLT matrix to apply.
[0234] Advanced KLT Matrix Signaling
[0235] In the above sections, training and block-level signaling methods are proposed and described. More specifically, the trained KLT matrix is fixed at both the encoder and the decoder. In practical applications, the statistical characteristics of video content are usually time-varying, that is, the statistical characteristics may vary for different frames or video sequences. In these cases, it is difficult to achieve optimal compression efficiency with a fixed KLT matrix. To address this problem of the fixed KLT matrix, an advanced adaptive KLT matrix signaling method is proposed in the present disclosure: (i) In a first aspect, it is proposed to adaptively signal the KLT matrix in the sequence parameter set (SPS). On the encoder side, the KLT matrix is derived for the sequence. The KLT matrix is then signaled in the SPS header; (2) In a second aspect, it is proposed to adaptively signal the KLT matrix in the picture parameter set (PPS). On the encoder side, the KLT matrix is derived for each picture. The KLT matrix is then signaled in the PPS header; and (3) In a third aspect, it is proposed to adaptively signal the KLT matrix in the slice header. On the encoder side, the KLT matrix is derived for each slice. The KLT matrix is then signaled in the slice header.
[0236] It should be noted that two methods are proposed in this disclosure to encode and decode the elements in the KLT matrix. In the first method, the elements in the KLT matrix are directly encoded and decoded using a canonical code (i.e., an Exponential Golomb (EG) code). In the second method, a fixed KLT matrix is used to predict an adaptive KLT matrix, and then the residual of the KLT matrix is further signaled using a canonical code.
[0237] LFNST for MTS
[0238] In current VVC and ECM, LFNST is applied between the forward main transform and quantization (at the encoder) and between inverse quantization and the inverse main transform (at the decoder). It should also be noted that LFNST is enabled only when MTS is not used in the main transform, that is, when DCT-II is applied to both the horizontal transform and the vertical transform. When MTS is used in the main transform, LFNST is not used. To further improve the encoding and decoding performance of LFNST, it is proposed to apply LFNST to transform blocks encoded with MST. The proposed LFNST kernel can be trained or derived offline and then fixed at the encoder and decoder sides.
[0239] In one or more embodiments, there are a total of 4 transform sets, and 2 non-separable transform matrices (kernels) are used for each transform set in the proposed LFNST for MTS. The mapping from intra prediction modes to transform sets is predefined, as shown in Table 3-10. If one of the three CCLM modes (INTRA_LT_CCLM, INTRA_T_CCLM, or INTRA_L_CCLM) is used for the current block (81 <= predModeIntra <= 83), transform set 0 is selected for the current chroma block. For each transform set, the selected non-separable secondary transform candidate is further specified by an explicitly signaled LFNST index. The index is signaled once for each intra CU in the bitstream after the transform coefficients.
[0240] In some other embodiments, there are 67 transform sets, that is, for each intra prediction mode, in the proposed LFNST, a corresponding transform set is used, and one non-separable transform matrix is used for each transform set. If the CU is encoded using TIMD mode, the intra mode is mapped to the transform index using the following method:
[0241] trIdx=(intraMode<2?intraMode:((intraMode>>1)+1))
[0242] Where intraMode is the intra mode, and trIdx is the index to the LFNST transform set.
[0243] It should be noted that the proposed LFNST for MTS can be used, but is not limited to the two schemes described above. Since LFNST is limited to being applicable only when all coefficients outside the first coefficient subgroup are non-significant, the LFNST index encoding and decoding depends on the position of the last significant coefficient. If more than one transform matrix is used in each transform set, LFNST indices need to be signaled, and LFNST indices may (or may not) be context-coded according to the intra prediction mode. In addition, LFNST is applied to intra CUs in both intra and inter slices, and to both luma and chroma. If dual tree is enabled, LFNST indices for luma and chroma are signaled separately. For inter slices (dual tree disabled), a single LFNST index is signaled and used for both luma and chroma.
[0244] KLT Zero
[0245] In order to reduce the computational complexity and memory space of the proposed KLT coefficients, the present disclosure proposes zeroing of the KLT, including spatial domain zeroing and frequency domain zeroing.
[0246] In spatial domain zeroing, a vector of dimension N is mapped to a vector of dimension K, where K is less than N. For a vector of dimension N, a typical non-separable transformation is a matrix multiplication between a KLT matrix and the vector, where the shape of the KLT matrix is N×N. In the proposed spatial domain zeroing method, the dimension of the positive KLT matrix is reduced from N×N to K×N. Therefore, the inverse KLT matrix is the transpose of the positive KLT matrix of dimension N×K. In the present disclosure, embodiments for deriving a KLT for spatial domain zeroing are proposed. It should be noted that the method for deriving the reduced KLT is not limited to the following embodiments.
[0247] In one embodiment, the KLT for spatial domain zeroing is derived by removing the eigenvectors in equations (5-7). The KLT matrix is expressed as in is the eigenvector (KLT basis). The eigenvector can be obtained by performing eigenvalue decomposition or SVD on the covariance matrix. Note that we have sorted the eigenvalues together with the eigenvectors in descending order of eigenvalues so that the energy of the transform coefficients has a descending order corresponding to the training samples. In this embodiment, the eigenvectors with smaller eigenvalues are deleted. The reduced KLT matrix can be expressed as follows:
[0248]
[0249] When KLT is used for the secondary transform of MTS, the proposed frequency domain zeroing is applied. After performing MTS on the residual block, the primary transform block is obtained. Only some primary transform coefficients are retained, while the others are discarded. Figures 12A-12D Some example zeroing methods for the main transform block are provided, where the blue areas indicate the areas where the transform coefficients are preserved.
[0250] Figure 12A An example of retaining transform coefficients in the upper left region is provided. Figure 12B An example of preserving transform coefficients in the upper region is provided. Figure 12C An example of preserving transform coefficients in the left region is provided. Figure 12D An example of retaining transform coefficients in a left and upper region is provided, where the left and upper region includes both an upper region and a left region.
[0251] In some embodiments, Figures 12A-12D In one embodiment, only Figures 12A-12D One of the zeroing methods in is applied to the primary transform block. In yet another embodiment, a zeroing method switching scheme is proposed. For each primary transform block, an index is signaled in the bitstream to indicate which zeroing method is applied to the block.
[0252] KLT matrix sharing
[0253] In the proposed KLT, the residual block or primary transform block is first converted from a rectangular block to a vector. Take the following 4×2 block as an example.
[0254]
[0255] Convert X to an eight-dimensional vector using raster scan order or vertical scan order:
[0256] or
[0257] The KLT operation can be described as where Ψ is the KLT matrix.
[0258] In a typical embodiment, the training and derivation of the KLT matrix is block shape dependent, i.e., different KLT matrices are trained for different block shapes. For example, when M is not equal to N, different KLT matrices are used for M×N blocks and N×M blocks.
[0259] To reduce the memory required to store KLT matrix coefficients, this disclosure proposes a KLT matrix sharing method. The basic idea behind KLT matrix sharing is to share the same KLT matrix between blocks of the same area. Several embodiments are proposed for KLT matrix sharing.
[0260] In one embodiment, blocks with the same area (number of samples in the block) share the same KLT matrix or set of KLT matrices. For example, 16×4 blocks, 8×8 blocks, and 4×16 blocks have different block shapes, but the same KLT matrix is applied to these blocks.
[0261] In yet another embodiment, if the width of one block A is the same as the height of another block B, and the height of block A is the same as the width of block B, then blocks A and B share the same KLT matrix or set of KLT matrices. For example, an H×W block and a W×H block may share the same KLT matrix or set of KLT matrices. In an embodiment, to use the shared KLT matrix, both the H×W block and the W×H block are first converted into W×H vectors of the same dimension using a specific scan order.
[0262] In a first method, a raster scan order, a vertical scan order, or any other scan order is applied to both HxW blocks and WxH blocks to convert the blocks into vectors.
[0263] In the second method, when converting blocks to vectors, raster scan order is applied to blocks of shape W × H, while vertical scan order is applied to blocks of shape H × W. Alternatively, vertical scan order is applied to blocks of shape W × H, while raster scan order is applied to blocks of shape H × W.
[0264] In the third method, any specific scanning order (including but not limited to raster scanning and vertical scanning order) is applied to a block of shape W×H. The block of shape H×W is first converted to a block of shape W×H. The scanning order for the W×H shape is then applied to the converted block to convert it into a vector.
[0265] In an embodiment of the present disclosure, a block is first converted into a vector using raster scanning or vertical scanning. In an example embodiment of KLT matrix sharing, for a block of size W×H, if the height H is greater than its width W, the block is first transposed into a block of size H×W, such as Figure 13 As shown, it is then converted into a vector using raster scanning or vertical scanning. The width, height and intra mode of the transposed block are used to identify the corresponding KLT matrix. Figure 13 As shown in , the W×H block before transposition is encoded using the intra mode of m1, that is, the prediction direction is from the lower left to the upper right. However, after the block is transposed, in addition to changing the block shape, the prediction direction is also changed, that is, the intra mode is changed to m2. Therefore, the corresponding KLT matrix of the transposed block is identified using intra mode m2 instead of m1. From the perspective of the decoder, when the block with a W×H shape and intra mode m1 is a rectangular block and its height is greater than the width, the shape of the transposed block and the mapped intra mode m2 are used to identify the KLT matrix. The mapped intra mode m2 is derived as follows.
[0266] In one embodiment, if the Wide Intra mode is not considered for KLT as described above, the mapped Intra mode m2 is derived as follows:
[0267] If m1 is DC mode or planar mode, then m2 = m1;
[0268] Otherwise, m2=68-m1.
[0269] In another embodiment, if the Wide Intra mode is considered for KLT as described above, the mapped Intra mode m2 is derived as follows:
[0270] If m1 is DC mode or planar mode, then m2 = m1;
[0271] Otherwise, if -14<=m1<=-1, then m2=66-m1;
[0272] Otherwise m2=68-m1.
[0273] It should be noted that in the above example implementation, if the height of a block is greater than its width, the block is transposed. However, the proposed KLT matrix sharing method is not limited to this implementation and allows other implementations. For example, we can set it so that if the width of a block is greater than its height, the block needs to be transposed.
[0274] In the embodiments of the present disclosure, the following methods and devices are proposed to derive KLT matrices and apply these new matrices in video codecs. An algorithm for KLT training is introduced. An improved KLT training data clustering method is proposed. A signaling method for KLT in video codecs is proposed. An asymmetric KLT method is proposed to deal with the quantization effect of transform coefficients. LFNST for MTS is also proposed to further improve the codec efficiency of LFNST. Finally, a high-level KLT matrix signaling method is proposed. A KLT zeroing method is proposed to reduce the computational complexity and the memory required to store the KLT matrix. A KLT matrix sharing method is proposed to reduce the memory required to store the KLT matrix. It is expected to further improve the codec efficiency of transform codecs in VVC and ECM.
[0275] Figure 14 14 is a flow chart illustrating a method 1400 for video decoding according to some examples of the present disclosure. At step 1401, the method 1400 includes, by a decoder, converting a current block into a current vector. At step 1402, the method includes, by the decoder, determining a transform matrix from a transform matrix set based on a block shape of the current block and an intra-frame prediction mode corresponding to the current block. At step 1403, the method 1400 includes, by the decoder, performing an inverse transform process on the current vector using the transform matrix.
[0276] In one example, converting the current block into the current vector includes: in response to determining that the height H of the current block is greater than or less than the width W of the current block, transposing, by the decoder, the current block into a transposed block having a width H and a height W; and converting the transposed block into the current vector.
[0277] In one example, intra prediction modes are grouped to correspond to different block shapes, and each intra prediction mode is mapped to at least one group; determining a transformation matrix according to the block shape of a current block and the intra prediction mode corresponding to the current block includes: receiving signaling indicating a first intra prediction mode corresponding to the current block; determining a second intra prediction mode for the transposed block according to the first intra prediction mode; and determining a transformation matrix according to the second intra prediction mode.
[0278] In one example, each intra-frame prediction mode has a different index; determining a transformation matrix based on the block shape of a current block and the intra-frame prediction mode corresponding to the current block includes: receiving a first index of a first intra-frame prediction mode; determining a second index of a second intra-frame prediction mode for a transposed block based on the first index of the first intra-frame prediction mode; and determining a transformation matrix based on the second index of the second intra-frame prediction mode.
[0279] In one example, determining the second index of the second intra-frame prediction mode for the transposed block based on the first index of the first intra-frame prediction mode includes: in response to the transformation process not considering the wide-angle intra-frame mode, and determining that the first index m1 of the first intra-frame prediction mode is 0 or 1, determining the second index m2 of the second intra-frame prediction mode to be the same as the first index m1; or in response to the transformation process not considering the wide-angle intra-frame mode, and determining that the first index m1 of the first intra-frame prediction mode is in the range of 2 to 66, determining the second index m2 of the second intra-frame prediction mode to be m2=68-m1.
[0280] In one example, determining the second index of the second intra-frame prediction mode for the transposed block based on the first index of the first intra-frame prediction mode includes: in response to a transformation process considering the wide-angle intra-frame mode, and determining that the first index m1 of the first intra-frame prediction mode is 0 or 1, determining the second index m2 of the second intra-frame prediction mode to be the same as the first index m1; in response to a transformation process considering the wide-angle intra-frame mode, and determining that the first index m1 of the first intra-frame prediction mode is in the range of -14 to -1, determining the second index m2 of the second intra-frame prediction mode to be m2=66-m1; or in response to a transformation process considering the wide-angle intra-frame mode, and determining that the first index m1 of the first intra-frame prediction mode is in the range of 2 to 66, determining the second index m2 of the second intra-frame prediction mode to be m2=68-m1.
[0281] In one example, converting the current block into the current vector includes converting the current block into the current vector in a first scanning order, wherein the first scanning order includes a raster scanning order or a vertical scanning order.
[0282] Figure 15 1 is a flow chart illustrating a method 1500 for video encoding according to some examples of the present disclosure. At step 1501, the method 1500 includes, by an encoder, converting a current block into a current vector. At step 1502, the method includes, by the encoder, determining a transform matrix from a transform matrix set based on a block shape of the current block and an intra prediction mode corresponding to the current block. At step 1503, the method 1500 includes, by the encoder, performing a transform process on the current vector using the transform matrix.
[0283] In one example, converting the current block to the current vector includes: in response to determining that the height H of the current block is greater than or less than the width W of the current block, transposing, by the encoder, the current block into a transposed block having a width H and a height W; and converting the transposed block to the current vector.
[0284] In one example, intra prediction modes are grouped to correspond to different block shapes, and each intra prediction mode is mapped to at least one group; and wherein determining a transform matrix based on the block shape of a current block and the intra prediction mode corresponding to the current block includes: determining a first intra prediction mode; determining a second intra prediction mode for the transposed block based on the first intra prediction mode; and determining a transform matrix based on the second intra prediction mode.
[0285] In one example, each intra-frame prediction mode has a different index; and wherein determining a transformation matrix based on a block shape of a current block and an intra-frame prediction mode corresponding to the current block includes: determining a first index of a first intra-frame prediction mode; determining a second index of a second intra-frame prediction mode for the transposed block based on the first index of the first intra-frame prediction mode; and determining a transformation matrix based on the second index of the second intra-frame prediction mode.
[0286] In one example, determining the second index of the second intra-frame prediction mode for the transposed block based on the first index of the first intra-frame prediction mode includes: in response to the transformation process not considering the wide-angle intra-frame mode, determining that the first index m1 of the first intra-frame prediction mode is 0 or 1, then determining the second index m2 of the second intra-frame prediction mode to be the same as the first index m1, or in response to the transformation process not considering the wide-angle intra-frame mode, determining that the first index m1 of the first intra-frame prediction mode is in the range of 2 to 66, then determining the second index m2 of the second intra-frame prediction mode to be m2=68-m1.
[0287] In one example, determining the second index of the second intra-frame prediction mode for the transposed block based on the first index of the first intra-frame prediction mode includes: in response to a transformation process considering the wide-angle intra-frame mode, and determining that the first index m1 of the first intra-frame prediction mode is 0 or 1, determining the second index m2 of the second intra-frame prediction mode to be the same as the first index m1; in response to a transformation process considering the wide-angle intra-frame mode, and determining that the first index m1 of the first intra-frame prediction mode is in the range of -14 to -1, determining the second index m2 of the second intra-frame prediction mode to be m2=66-m1; or in response to a transformation process considering the wide-angle intra-frame mode, and determining that the first index m1 of the first intra-frame prediction mode is in the range of 2 to 66, determining the second index m2 of the second intra-frame prediction mode to be m2=68-m1.
[0288] In one example, converting the current block into the current vector includes converting the current block into the current vector in a first scanning order, wherein the first scanning order includes a raster scanning order or a vertical scanning order.
[0289] Figure 16The computing environment 1610 is shown coupled to a user interface 1650. The computing environment 1610 may be part of a data processing server. The computing environment 1610 includes a processor 1620, a memory 1630, and an input / output (I / O) interface 1640.
[0290] The processor 1620 generally controls the overall operation of the computing environment 1610, such as operations associated with display, data acquisition, data communication, and image processing. The processor 1620 may include one or more processors to execute instructions to perform all or some of the steps in the above-described method. In addition, the processor 1620 may include one or more modules that facilitate interaction between the processor 1620 and other components. The processor may be a central processing unit (CPU), a microprocessor, a single-chip microcomputer, a graphics processing unit (GPU), etc.
[0291] Memory 1630 is configured to store various types of data to support the operation of computing environment 1610. Memory 1630 may include predetermined software 1632. Examples of such data include instructions for any application or method operating on computing environment 1610, video data sets, image data, and the like. Memory 1630 may be implemented 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.
[0292] In one example, the memory 1630 is configured to store instructions executable by the processor; wherein the processor is configured to perform the following when executing the instructions: Figure 14-15 Any method shown.
[0293] I / O interface 1640 provides an interface between processor 1620 and peripheral interface modules (such as a keyboard, click wheel, buttons, etc.). Buttons may include, but are not limited to, a home button, a start scan button, and a stop scan button. I / O interface 1640 may be coupled to an encoder and a decoder.
[0294] In an embodiment, a non-transitory computer-readable storage medium including a plurality of programs is further provided, wherein the plurality of programs are, for example, in the memory 1630 and can be executed by the processor 1620 in the computing environment 1610 to perform the above-mentioned method and / or store the bit stream generated by the above-mentioned encoding method or the bit stream decoded by the above-mentioned decoding method. In one example, the plurality of programs can be executed by the processor 1620 in the computing environment 1610 to receive (for example, from Figure 2 The video encoder 20 in the computing environment 1610 receives a bit stream 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 the processor 1620 in the computing environment 1610 can also be executed to perform the above-mentioned decoding method according to the received bit stream or data stream. In another example, multiple programs can be executed by the processor 1620 in the computing environment 1610 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 bit stream or data stream, and can also be executed by the processor 1620 in the computing environment 1610 to send the bit stream or data stream (e.g., to a video frame). Figure 3A Optionally, a non-transitory computer-readable storage medium may store therein a bitstream or data stream comprising a video decoder 30 in the video decoder 30). Figure 2 The video encoder 20 in FIG. 1 generates a video stream for a decoder (eg, Figure 3A or Figure 3B The video decoder 30 in the video decoder 30 is used to decode the video data. The non-transitory computer-readable storage medium may 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.
[0295] In an embodiment, a bitstream generated by the above encoding method or a bitstream decoded by the above decoding method is provided. In an embodiment, a bitstream including coded video information generated by the above encoding method or coded video information to be decoded by the above decoding method is provided.
[0296] In an embodiment, a computing device is also provided that includes one or more processors (e.g., processor 1620); and a non-transitory computer-readable storage medium or memory 1630 having stored therein a plurality of programs executable by the one or more processors, wherein the one or more processors are configured to perform the above-described method when executing the plurality of programs.
[0297] In an embodiment, a computer program product is also provided, the computer program product having instructions for storing or transmitting a bitstream, wherein the bitstream includes encoded video information generated by the above encoding method or encoded video information decoded by the above decoding method. In an embodiment, a computer program product including multiple programs is also provided, wherein the multiple programs are, for example, stored in memory 1630 and can be executed by processor 1620 in computing environment 1610 to perform the above method. For example, the computer program product may include a non-transitory computer-readable storage medium.
[0298] In an embodiment, the computing environment 1610 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 to perform the above methods.
[0299] In an embodiment, a method for storing a bitstream is further provided, comprising storing the bitstream on a digital storage medium, wherein the bitstream comprises encoded video information generated by the above encoding method or encoded video information decoded by the above decoding method.
[0300] In an embodiment, a method for transmitting a bit stream generated by the above encoder is also provided. In an embodiment, a method for receiving a bit stream to be decoded by the above decoder is also provided.
[0301] The description of the present disclosure has been presented for purposes of illustration and is not intended to be exhaustive or limiting of the present disclosure. Many modifications, variations, and alternative embodiments will be apparent to one skilled in the art having the benefit of the teachings presented in the foregoing description and the associated drawings.
[0302] Unless otherwise specified, the order of the method steps according to the present disclosure is intended to be illustrative only, and the method steps 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 of the method steps according to the present disclosure may be adjusted, combined, or deleted according to actual requirements.
[0303] The embodiments are chosen and described in order to explain the principles of the present disclosure and to enable others 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 as are suited to the particular 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 that modifications and other embodiments are intended to be included within the scope of the present disclosure.
[0304] The above methods can be implemented using an apparatus comprising one or more circuits, including an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a controller, a microcontroller, a microprocessor, or other electronic components. The apparatus can use the circuits in combination with other hardware or software components to perform the above methods. Each module, submodule, unit, or subunit disclosed above can be implemented, at least in part, using one or more circuits.
[0305] Other embodiments of the present disclosure will be apparent to those skilled in the art by considering the specification and practice of the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include deviations from the present disclosure within the scope of known or customary practices in the art. This specification and examples are for reference only. This specification and examples are to be considered exemplary. This application is intended to cover any variations, uses, or adaptations of the present disclosure.
[0306] It will be understood that the present disclosure is not limited to the exact embodiments described above and shown in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A method for video decoding, comprising: The decoder converts the current block into the current vector; Determining, by the decoder, a transformation matrix from a transformation matrix set according to a block shape of the current block and an intra prediction mode corresponding to the current block; as well as An inverse transform process is performed by the decoder on the current vector by using the transform matrix.
2. The method of claim 1 , wherein converting the current block into the current vector comprises: In response to determining that a height H of the current block is greater than or less than a width W of the current block, transposing, by the decoder, the current block into a transposed block having a width H and a height W; as well as The transposed block is converted to the current vector.
3. The method according to claim 2, wherein: Intra prediction modes are grouped to correspond to different block shapes, and each intra prediction mode is mapped to at least one group; and Wherein determining the transformation matrix according to the block shape of the current block and the intra prediction mode corresponding to the current block includes: receiving signaling indicating a first intra prediction mode corresponding to the current block; determining a second intra prediction mode for the transposed block according to the first intra prediction mode; and The transformation matrix is determined according to the second intra prediction mode.
4. The method of claim 3, wherein each intra prediction mode has a different index; and Wherein determining the transformation matrix according to the block shape of the current block and the intra prediction mode corresponding to the current block includes: receiving a first index of a first intra prediction mode; determining a second index of a second intra prediction mode for the transposed block according to the first index of the first intra prediction mode; as well as The transformation matrix is determined according to the second index of the second intra prediction mode.
5. The method according to claim 4, wherein determining the second index of the second intra prediction mode for the transposed block according to the first index of the first intra prediction mode comprises: In response to performing the transform process without considering the wide-angle intra mode and determining that the first index m1 of the first intra prediction mode is 0 or 1, determining the second index m2 of the second intra prediction mode to be the same as the first index m1; or In response to performing the transform process without considering the wide-angle intra mode and determining that the first index m1 of the first intra prediction mode is within the range of 2 to 66, the second index m2 of the second intra prediction mode is determined to be m2=68-m1.
6. The method according to claim 5, wherein determining the second index of the second intra prediction mode for the transposed block according to the first index of the first intra prediction mode comprises: In response to performing the transform process in consideration of the wide-angle intra mode and determining that the first index m1 of the first intra prediction mode is 0 or 1, determining the second index m2 of the second intra prediction mode to be the same as the first index m1; In response to performing the transform process considering the wide-angle intra mode and determining that the first index m1 of the first intra prediction mode is in the range of -14 to -1, determining the second index m2 of the second intra prediction mode to be m2=66-m1; or In response to the transform process being performed in consideration of the wide intra mode and determining that the first index m1 of the first intra prediction mode is within the range of 2 to 66, the second index m2 of the second intra prediction mode is determined to be m2=68-m1.
7. The method of claim 1 , wherein converting the current block into the current vector comprises: The current block is converted into the current vector in a first scanning order, where the first scanning order includes a raster scanning order or a vertical scanning order.
8. A method for video encoding, comprising: The encoder converts the current block into the current vector; Determining, by the encoder, a transformation matrix from a transformation matrix set according to a block shape of the current block and an intra prediction mode corresponding to the current block; and A transform process is performed by the encoder on the current vector by using the transform matrix.
9. The method of claim 8, wherein converting the current block into the current vector comprises: In response to determining that the height H of the current block is greater than or less than the width W of the current block, transposing, by the encoder, the current block into a transposed block having a width H and a height W; and The transposed block is converted to the current vector.
10. The method of claim 9, wherein the intra prediction modes are grouped to correspond to different block shapes, and each intra prediction mode is mapped to at least one group; and Wherein determining the transformation matrix according to the block shape of the current block and the intra prediction mode corresponding to the current block includes: determining a first intra prediction mode; determining a second intra prediction mode for the transposed block according to the first intra prediction mode; and The transformation matrix is determined according to the second intra prediction mode.
11. The method of claim 10, wherein each intra prediction mode has a different index; and Wherein determining the transformation matrix according to the block shape of the current block and the intra prediction mode corresponding to the current block includes: determining a first index of a first intra prediction mode; determining a second index of a second intra prediction mode for the transposed block according to the first index of the first intra prediction mode; as well as The transformation matrix is determined according to the second index of the second intra prediction mode.
12. The method according to claim 11, wherein determining the second index of the second intra prediction mode for the transposed block according to the first index of the first intra prediction mode comprises: In response to performing the transformation process without considering the wide-angle intra mode, determining that the first index m1 of the first intra prediction mode is 0 or 1, determining the second index m2 of the second intra prediction mode to be the same as the first index m1, or, In response to performing the transformation process without considering the wide-angle intra mode, determining that the first index m1 of the first intra prediction mode is in the range of 2 to 66, the second index m2 of the second intra prediction mode is determined to be m2=68-m1.
13. The method according to claim 13, wherein determining the second index of the second intra prediction mode for the transposed block according to the first index of the first intra prediction mode comprises: In response to performing the transform process in consideration of the wide-angle intra mode and determining that the first index m1 of the first intra prediction mode is 0 or 1, determining the second index m2 of the second intra prediction mode to be the same as the first index m1; In response to performing the transform process considering the wide-angle intra mode and determining that the first index m1 of the first intra prediction mode is in the range of -14 to -1, determining the second index m2 of the second intra prediction mode to be m2=66-m1; or In response to the transform process being performed in consideration of the wide intra mode and determining that the first index m1 of the first intra prediction mode is within the range of 2 to 66, the second index m2 of the second intra prediction mode is determined to be m2=68-m1.
14. The method of claim 9, wherein converting the current block into the current vector comprises: The current block is converted into the current vector in a first scanning order, where the first scanning order includes a raster scanning order or a vertical scanning order.
15. A device for video decoding, comprising: one or more processors; as well as a memory coupled to the one or more processors and configured to store instructions executable by the one or more processors, Wherein, when executing the instructions, the one or more processors are configured to perform the method according to any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium for storing computer-executable instructions that, when executed by one or more computer processors, cause the one or more computer processors to 17. Perform the method of any one of claims 1 to 7.
18. An apparatus for video encoding, comprising: one or more processors; as well as a memory coupled to the one or more processors and configured to store instructions executable by the one or more processors, Wherein, when executing the instructions, the one or more processors are configured to perform the method of any one of claims 8 to 14.
19. A non-transitory computer-readable storage medium for storing computer-executable instructions, which, when executed by one or more computer processors, cause the one or more computer processors to perform the method of any one of claims 8 to 14.
20. A non-transitory computer-readable storage medium for storing a bit stream to be decoded by the method of any one of claims 1-7.
21. A non-transitory computer-readable storage medium for storing a bitstream generated by the method of any one of claims 8 to 14.