Codec method, codestream, encoder, decoder, and computer storage medium
By determining the last non-zero coefficient position for each image component, the codec method optimizes the encoding and decoding process, addressing inefficiencies in high-bitwidth, high-bitrate, high-quality video codecs and enhancing compression efficiency.
Patent Information
- Application Number
- JP2025134529
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-10-28
AI Technical Summary
Existing high-bitwidth, high-bitrate, high-quality video codecs suffer from significant overhead in the codestream due to larger coefficients, leading to inefficiencies in compression.
A codec method and device that determine the position of the last non-zero coefficient for each image component, using component identification information to control the derivation method, allowing for efficient encoding and decoding by reducing coding overhead through a predetermined scanning order.
Improves compression efficiency in high-bitwidth, high-bitrate, high-quality video codecs by optimizing the coding process based on the distribution of non-zero coefficients, thereby reducing unnecessary data transmission.
Smart Images

Figure 2025163269000001_ABST
Abstract
Description
[Technical Field]
[0001] The present application relates to the field of video codec technology, and in particular to a codec method, a codestream, an encoding device, a decoding device, and a computer storage medium. [Background technology]
[0002] As people's demands for video display quality increase, computer vision-related fields have attracted increasing attention. In recent years, image processing technology has been applied to various industries with successful results. In video image codec processing, on the encoding side, image data to be encoded is subjected to transformation and quantization processes, and then compressed and coded by an entropy coding unit. The code stream generated after the entropy coding process is transmitted to the decoding side. The code stream is then analyzed, and the original input image data can be restored after inverse quantization and inverse transformation processes.
[0003] Currently, high-bitwidth, high-quality, high-bitrate video codecs (abbreviated as "triple-high video") typically require more and larger coefficients than low-bitwidth, low-quality, low-bitrate video codecs (which may be called "conventional video"). As such, existing related solutions for triple-high video can introduce significant overhead into the codestream, potentially resulting in waste. Summary of the Invention [Problem to be solved by the invention]
[0004] The embodiments of the present application provide a codec method, codestream, encoding device, decoding device, and computer storage medium that can be applied to high-bitwidth, high-bitrate, high-quality, or lossless-compression video codec scenes and can improve compression efficiency. [Means for solving the problem]
[0005] The technical solutions of the embodiments of the present application can be realized as follows:
[0006] In a first aspect, an embodiment of the present application provides a decoding method applied to a decoding device, the method comprising: Parsing the codestream to determine component identification information of a current slice, and determining coordinate information of a last non-zero coefficient of a current block corresponding to the component of the current slice; If the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion, calculating coordinate information of the last non-zero coefficient to obtain the position of the last non-zero coefficient of the current block; Decoding all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order to determine the coefficients of the current block.
[0007] In a second aspect, an embodiment of the present application provides an encoding method applied to an encoding device, the method comprising: determining component identification information for the current slice and determining the location of the last non-zero coefficient of the current block corresponding to the component of the current slice; determining coordinate information of the last non-zero coefficient of the current block based on the component identification information and the location of the last non-zero coefficient; encoding all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, and writing bit information, component identification information, and coordinate information of the last non-zero coefficient obtained by the encoding into a codestream.
[0008] In a third aspect, an embodiment of the present application provides a codestream, wherein the codestream is generated by performing bit encoding based on encoding target information, wherein the encoding target information includes at least one of first syntax element identification information, second syntax element identification information, third syntax element identification information, component identification information, last coefficient enable identification information, and sub-block default encoding identification information; The first syntax element identification information is used to indicate whether the current sequence allows the use of last non-zero coefficient position inversion, the second syntax element identification information is used to indicate whether the current sequence uses the standard extended version, the third syntax element identification information is used to indicate whether the current sequence uses range extension, the component identification information is used to indicate whether the component of the current slice uses last non-zero coefficient position inversion, the last coefficient enable identification information is used to indicate whether the current block uses the last coefficient position, the sub-block default coding identification information is used to indicate whether the sub-block to be coded in the current block is coded by default, the current sequence includes the current slice, and the current slice includes the current block.
[0009] In a fourth aspect, an embodiment of the present application provides a coding device, the coding device comprising: a first determining unit; and a coding unit; The first determining unit is configured to determine component identification information of a current slice, and determine a position of a last non-zero coefficient of the current block corresponding to the component of the current slice; The first determining unit is further configured to determine, according to the component identification information and the position of the last non-zero coefficient, coordinate information of the last non-zero coefficient of the current block; The encoding unit is configured to encode all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, and write bit information, component identification information, and coordinate information of the last non-zero coefficient obtained by the encoding into a codestream.
[0010] In a fifth aspect, an embodiment of the present application provides an encoding device, the encoding device comprising: a first memory; and a first processor; the first memory is configured to store a computer program executable by the first processor; The first processor is configured to perform the method according to the second aspect when executing the computer program.
[0011] In a sixth aspect, an embodiment of the present application provides a decoding device, the decoding device comprising: an analyzing unit; and a second determining unit; The parsing unit is configured to parse the codestream, determine component identification information of a current slice, and determine coordinate information of a last non-zero coefficient of a current block corresponding to the component of the current slice; The second determining unit is configured to calculate coordinate information of the last non-zero coefficient to obtain a position of the last non-zero coefficient of the current block when the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion; The analysis unit is further configured to decode all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order to determine the coefficients of the current block.
[0012] In a seventh aspect, an embodiment of the present application provides a decoding device, the decoding device comprising: a second memory; and a second processor; the second memory is configured to store a computer program executable by the second processor; The second processor is configured to perform the method according to the first aspect when executing the computer program.
[0013] In an eighth aspect, an embodiment of the present application provides a computer storage medium having a computer program stored therein, the computer program, when executed, realizing the method according to the first aspect or the method according to the second aspect.
[0014] The present application provides a codec method, a codestream, an encoding device, a decoding device, and a computer storage medium, in which the encoding device determines component identification information of a current slice, determines the position of the last non-zero coefficient of a current block corresponding to the component of the current slice, determines coordinate information of the last non-zero coefficient of the current block based on the component identification information and the position of the last non-zero coefficient, encodes all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, and writes bit information, the component identification information, and the coordinate information of the last non-zero coefficient obtained by encoding into a codestream. The decoding device analyzes the codestream, determines component identification information of the current slice, and determines coordinate information of the last non-zero coefficient of the current block corresponding to the component of the current slice. If the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion, calculates the coordinate information of the last non-zero coefficient to obtain the position of the last non-zero coefficient of the current block, and decodes all coefficients before the position of the last non-zero coefficient according to the predetermined scanning order to determine the coefficients of the current block. In this way, in a video codec scenario with a high bit width, a high bit rate, high quality, or lossless compression, by setting a reasonable derivation method for the last non-zero coefficient according to the law of non-zero coefficient distribution, it is possible to reduce the coding overhead in the code stream and improve compression efficiency. In addition, since the law of non-zero coefficient distribution of each image component is different, it is also possible to use the component identification information to control the derivation method for the last non-zero coefficient for each image component, that is, to control whether each image component uses the last non-zero coefficient position inversion technique, thereby further improving compression efficiency. [Brief explanation of the drawings]
[0015] [Figure 1] FIG. 1 is a schematic diagram illustrating the application of an encoding framework according to the related art; [Figure 2] FIG. 1 is a schematic diagram showing the positional relationship between a current coefficient and adjacent coefficients according to the related art. [Figure 3] 1 is a flowchart of a bin arithmetic decoding process according to the related art; [Figure 4] 1 is a flowchart of a process for arithmetic decoding of binary symbols according to the related art. [Figure 5] 1 is a flowchart of renormalization of an arithmetic decoding engine according to the related art; [Figure 6] 1 is a flowchart of a bypass decoding process according to the related art. [Figure 7] FIG. 10 is a schematic diagram showing the positional relationship between an area that may have zero coefficients and an area that is forced to be zero according to the related art. [Figure 8A] 1 is a schematic diagram illustrating a system configuration of an encoding device according to an embodiment of the present application; [Figure 8B] 1 is a schematic diagram illustrating a system configuration of a decoding device according to an embodiment of the present application; [Figure 9] 1 is a schematic diagram illustrating a system configuration of a decoding device according to an embodiment of the present application; [Figure 10A] FIG. 10 is a schematic diagram of the location of the last non-zero coefficient relative to the top-left corner of the current block according to an embodiment of the present application; [Figure 10B] FIG. 10 is a schematic diagram of the location of the last non-zero coefficient relative to the bottom right corner of the current block according to an embodiment of the present application. [Figure 11] 1 is a flowchart of an encoding method according to an embodiment of the present application; [Figure 12] 1 is a schematic diagram illustrating a configuration of an encoding device according to an embodiment of the present application; [Figure 13] FIG. 2 is a schematic diagram illustrating a specific hardware configuration of an encoding device according to an embodiment of the present application. [Figure 14] FIG. 1 is a schematic diagram illustrating a configuration of a decoding device according to an embodiment of the present application. [Figure 15] FIG. 2 is a schematic diagram illustrating a specific hardware configuration of a decoding device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE INVENTION
[0016] In order to understand the features and technical contents of the embodiments of the present application in more detail, the following detailed description of the embodiments of the present application will be given with reference to the accompanying drawings, which are for reference purposes only and are not intended to limit the embodiments of the present application.
[0017] Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art. The terms used herein are used only to describe the embodiments of the present application and are not intended to limit the present application.
[0018] In the following, references to "some embodiments" describe a subset of all possible embodiments, but it should be understood that "some embodiments" may refer to the same or different subsets of all possible embodiments, and may be combined with each other if not inconsistent. Note that terms such as "first / second / third" used herein do not limit a particular order, but rather distinguish between similar objects. It should be understood that "first / second / third" can be used to interchange a particular order or order where appropriate, so that the embodiments described herein can be performed in an order other than that shown or described herein.
[0019] In a video image, a coding block (CB) is usually represented by a first image component, a second image component, and a third image component, where the three image components are a luma component, a blue chroma component, and a red chroma component, respectively, and specifically, the luma component is usually represented by the symbol Y, the blue chroma component is usually represented by the symbol Cb or U, and the red chroma component is usually represented by the symbol Cr or V. Thus, the video image can be represented in a YCbCr format or a YUV format.
[0020] Before describing the embodiments of the present application in more detail, the nouns and terms used in the embodiments of the present application will be explained. The explanation of the nouns and terms used in the embodiments of the present application is as follows.
[0021] Moving Picture Experts Group (MPEG) Joint Video Experts Team (JVET) Alliance for Open Media (AOM) Next-generation video coding standard H.266 / Versatile Video Coding (VVC) VVC Reference Software Test Platform (VTM: VVC Test Model) Audio Video Standard (AVS) High-Performance Model (HPM) for AVS Context-based Adaptive Binary Arithmetic Coding (CABAC) Raw Byte Sequence Payload (RBSP) Regular Residual Coding (RRC) Transform Skip Residual Coding (TSRC) As can be understood, current common video codec standards (such as VVC) use a block-based hybrid coding framework. Each frame in a video image is divided into square largest coding units (LCUs) of the same size (e.g., 128x128, 64x64, etc.), and each LCU is divided into rectangular coding units (CUs) according to a rule. The coding units may also be divided into smaller prediction units (PUs), transform units (TUs), etc. Specifically, as shown in FIG. 1, the hybrid coding framework may include modules such as prediction, transform, quantization, entropy coding, and in-loop filtering. Here, the prediction module may include intra-frame prediction and inter-frame prediction, and the inter-frame prediction may include motion estimation and motion compensation. Because there is a strong correlation between adjacent pixels within one frame of a video image, the intra-frame prediction method in video codec technology can eliminate the spatial redundancy between adjacent pixels, but because there is a high similarity between adjacent frames within a video image, the inter-frame prediction method in video codec technology can eliminate the temporal redundancy between adjacent frames, thereby improving the codec efficiency.
[0022] The basic process of a video codec is as follows: the encoding device divides a frame image into blocks, uses intra-frame or inter-frame prediction on the current block to generate a predicted block for the current block, subtracts the predicted block from the original block of the current block to obtain a residual block, transforms and quantizes the residual block to obtain a quantized coefficient matrix, and entropy-encodes the quantized coefficient matrix and outputs it as a code stream. The decoding device uses intra-frame or inter-frame prediction on the current block to generate a predicted block for the current block, decodes the code stream to obtain a quantized coefficient matrix, performs inverse quantization and inverse transform on the quantized coefficient matrix to obtain a residual block, and adds the predicted block and the residual block to obtain a reconstructed block. The reconstructed block forms a reconstructed image, and the reconstructed image is filtered in a loop based on the image or block to obtain a decoded image. The encoding device also needs to obtain a decoded image using operations similar to those of the decoding device. The decoded image can use a subsequent frame as a reference frame for inter-frame prediction. The block division information and mode or parameter information such as prediction, transform, quantization, entropy coding, and in-loop filtering determined by the encoding device are output to the codestream as needed. The decoding device then determines the same block division information and mode or parameter information such as prediction, transform, quantization, entropy coding, and in-loop filtering as the encoding device through analysis and analysis based on existing information, thereby ensuring that the decoded image obtained by the encoding device is the same as the decoded image obtained by the decoding device. The decoded image obtained by the encoding device is also usually called a reconstructed image. During prediction, the current block can be divided into prediction units, and during transformation, the current block can be divided into transform units, and the division of the prediction units and the transform units may be different.The above is the basic process of a video encoding device and a video decoding device in a block-based hybrid coding framework, and as technology develops, some modules or steps of the framework or process may be optimized. The embodiments of the present application are applicable to the basic process of a video encoding device and a video decoding device in the block-based hybrid coding framework, but are not limited to the framework and process.
[0023] In an embodiment of the present application, the current block may be a current coding unit (CU), a current prediction unit (PU), a current transform block (TU), or the like. Here, block partition information, various modes and parameter information for prediction, transform, and quantization, coefficients, and the like are written into a codestream by entropy coding. By assuming that elements have different probabilities, shorter codewords are assigned to elements with higher occurrence probabilities and longer codewords are assigned to elements with lower occurrence probabilities, achieving higher coding efficiency than fixed-length coding. However, when the probabilities of different elements are close or nearly equal, the entropy coding compression space is limited. CABAC is a common entropy coding method, and HEVC, VVC, and the like use CABAC to perform entropy coding. CABAC can improve compression efficiency by using a context model, but the use and update of the context model complicates operation. CABAC has a bypass mode, which does not require the use and update of a context model and can achieve higher throughput. In the present embodiment, the mode in which the context model needs to be used and updated in CABAC can be called the context mode.
[0024] TIFF2025163269000002.tif89170
[0025] In the CABAC arithmetic coding engine, when the context mode needs to be used, the defined binary symbol arithmetic decoding process needs to be invoked, which includes the state transition process, i.e., updating the context model. On the other hand, the binary symbol arithmetic decoding process invokes the renormalization process of the arithmetic decoding engine. When the bypass mode is used, the bypass decoding process needs to be invoked.
[0026] In the following, an example of using CABAC in VVC will be described.
[0027] TIFF2025163269000003.tif24170
[0028] TIFF2025163269000004.tif16170
[0029] TIFF2025163269000005.tif43170
[0030] TIFF2025163269000006.tif25170
[0031] TIFF2025163269000007.tif17170
[0032] TIFF2025163269000008.tif23170
[0033] TIFF2025163269000009.tif43170
[0034] TIFF2025163269000010.tif34170
[0035] TIFF2025163269000011.tif42170
[0036] TIFF2025163269000012.tif17170
[0037] TIFF2025163269000013.tif25170
[0038] TIFF2025163269000014.tif15170
[0039] TIFF2025163269000015.tif24170
[0040] TIFF2025163269000016.tif62170
[0041] TIFF2025163269000017.tif34170
[0042] TIFF2025163269000018.tif24170
[0043] TIFF2025163269000019.tif26170
[0044] TIFF2025163269000020.tif16170
[0045] TIFF2025163269000021.tif66170
[0046] TIFF2025163269000022.tif16170
[0047] TIFF2025163269000023.tif25170
[0048] TIFF2025163269000024.tif66170
[0049] TIFF2025163269000025.tif61170
[0050] In addition, current video codec standards typically support one or more transforms and transform skips for the residual. Transforms include the Discrete Cosine Transform (DCT), and a residual block that uses a transform typically exhibits certain characteristics after transformation (and quantization). For example, after several transforms (and quantization), energy is concentrated in the low-frequency region, resulting in large region coefficients in the upper left corner and small region coefficients in the lower right corner, and even many zero coefficients. A transform skip literally means no transformation. Since the distribution law of coefficients after a transform skip is different from that of post-transform coefficients, different coefficient coding methods can be used. For example, VVC uses RRC for post-transform coefficients and TSRC for transform skip coefficients.
[0051] In a typical transform, such as a DCT transform, the transformed block is arranged from left to right, representing low to high frequencies, and from top to bottom, representing low to high frequencies. The upper left corner represents low frequencies, and the lower right corner represents high frequencies. The human eye is more sensitive to low-frequency information and less sensitive to high-frequency information. Taking advantage of this characteristic, some high-frequency information can be processed more or removed, reducing the visual impact. Techniques such as zero-out can force some high-frequency information to zero. For example, for a 64x64 block, coefficients at positions with abscissas greater than or equal to 32 or ordinates greater than 32 are forced to zero. The above is a simple example; more complex derivations of the zero-out range may exist, and will not be repeated here. As shown in Figure 7, the upper left corner may contain non-zero coefficients (i.e., a non-zero coefficient region may exist), while the lower right corner is all zeros (i.e., a region forced to zero). In this way, in the case of subsequent coefficient coding, the coefficients in the area that have been forced to 0 by zero-out are always 0 and do not need to be coded.
[0052] TIFF2025163269000026.tif98170
[0053] TIFF2025163269000027.tif43170
[0054] TIFF2025163269000028.tif43170
[0055] TIFF2025163269000029.tif36170
[0056] TIFF2025163269000030.tif62170
[0057] TIFF2025163269000031.tif37170
[0058] TIFF2025163269000032.tif61170
[0059] TIFF2025163269000033.tif51170
[0060] TIFF2025163269000034.tif18170
[0061] TIFF2025163269000035.tif29170
[0062] Furthermore, when processing coefficient coding, the compression efficiency can be improved by utilizing the characteristics of the coefficients. For example, in conventional video, a certain percentage of the coefficients that need to be coded are zero, so one syntax element can be used to represent whether the current coefficient is zero, and this syntax element is usually one binary symbol. If the current coefficient is zero, it means that coding for the current coefficient has finished; if not, coding of the current coefficient needs to continue. In another example, in conventional video, the absolute values of a certain percentage of the non-zero coefficients are one, so one syntax element can be used to represent whether the absolute value of the current coefficient is greater than one, and this syntax element is usually one binary symbol. If the absolute value of the current coefficient is not greater than one, it means that coding for the current coefficient has finished; if not, coding of the current coefficient needs to continue. For example, syntax elements related to VVC are as follows:
[0063] TIFF2025163269000036.tif59170
[0064] TIFF2025163269000037.tif59170
[0065] TIFF2025163269000038.tif40170
[0066] TIFF2025163269000039.tif30170
[0067] TIFF2025163269000040.tif53170
[0068] TIFF2025163269000041.tif31170
[0069] TIFF2025163269000042.tif25170
[0070] TIFF2025163269000043.tif32170
[0071] TIFF2025163269000044.tif81170
[0072] TIFF2025163269000045.tif32170
[0073] TIFF2025163269000046.tif68170
[0074] TIFF2025163269000047.tif46170
[0075] TIFF2025163269000048.tif29170
[0076] TIFF2025163269000049.tif19169
[0077] TIFF2025163269000050.tif41170
[0078] TIFF2025163269000051.tif17170
[0079] TIFF2025163269000052.tif34170
[0080] TIFF2025163269000053.tif19170
[0081] TIFF2025163269000054.tif14170
[0082] Here, encoding in context mode requires selecting, using, and updating the context mode, while encoding in bypass mode does not require selecting, using, or updating the context mode. Generally, syntax elements encoded in context mode are arranged together within a certain range, and syntax elements encoded in bypass mode are arranged together, which is more friendly to hardware design. For example, first, all syntax elements encoded in context mode within one block are processed, and then syntax elements encoded in bypass mode are processed. All syntax elements encoded in context mode within the current block are further divided into several groups, and all syntax elements encoded in bypass mode within one block are further divided into several groups.
[0083] In a specific example, the specific syntax of the RRC is shown in Table 1.
[0084] [Table 1(1)] [Table 1(2)] [Table 1(3)] [Table 1(4)] [Table 1(5)] [Table 1(6)] [Table 1(7)]
[0085] TIFF2025163269000062.tif44170
[0086] TIFF2025163269000063.tif239170
[0087] In another specific example, the specific syntax of the TSRC is shown in Table 2.
[0088] [Table 2(1)] [Table 2(2)] [Table 2(3)] [Table 2(4)] [Table 2(5)]
[0089] TIFF2025163269000069.tif155170
[0090] In short, in the related art, this existing coefficient coding method has excellent compression efficiency for currently commonly used videos, such as consumer videos. Consumer videos usually have a bit width of 8 or 10 bits per pixel, and the bit rate of consumer videos is usually not very high, usually a few megabits per second (MB / s) or less. However, some applications of video require a higher bit width, for example, a bit width of 12, 14, 16, or more bits per pixel. A higher bit width usually results in larger coefficients and more non-zero coefficients, thereby resulting in a higher bit rate. Some applications of video require higher quality, and higher quality also usually results in larger coefficients and more non-zero coefficients, thereby resulting in a higher bit rate. The higher the bit rate, the higher the demands on the processing capabilities of the decoding device, such as throughput.
[0091] TIFF2025163269000070.tif170170
[0092] On the other hand, the last non-zero coefficient position and a flag indicating whether the sub-block is coded are coded in context mode, and coding in context mode is more complex than coding in bypass mode, and processing this information also affects the speed and throughput of software and hardware codecs.
[0093] TIFF2025163269000071.tif88170
[0094] An embodiment of the present application provides a decoding method, which determines component identification information of a current slice by analyzing a codestream, determines coordinate information of a last non-zero coefficient of a current block corresponding to the component of the current slice, and if the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion, calculates the coordinate information of the last non-zero coefficient to obtain the position of the last non-zero coefficient of the current block, and decodes all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order to determine the coefficients of the current block.
[0095] An embodiment of the present application further provides an encoding method, which determines the position of the last non-zero coefficient of the current block corresponding to the component of the current slice by determining component identification information of the current slice; determines coordinate information of the last non-zero coefficient of the current block based on the component identification information and the position of the last non-zero coefficient; encodes all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order; and writes the bit information, component identification information, and coordinate information of the last non-zero coefficient obtained by encoding into a codestream.
[0096] In this way, in a video codec scenario with a high bit width, a high bit rate, high quality, or lossless compression, by setting a reasonable derivation method for the last non-zero coefficient according to the law of non-zero coefficient distribution, it is possible to reduce the coding overhead in the code stream and improve compression efficiency. In addition, since the law of non-zero coefficient distribution of each image component is different, it is also possible to use the component identification information to control the derivation method for the last non-zero coefficient for each image component, that is, to control whether each image component uses the last non-zero coefficient position inversion technique, thereby further improving compression efficiency.
[0097] Each embodiment of the present invention will be described in detail below with reference to the drawings.
[0098] 8A, which is a schematic diagram illustrating a system configuration of an encoding device according to an embodiment of the present application. As shown in FIG. 8A, the encoding device 100 may include a division unit 101, a prediction unit 102, a first adder 107, a transformation unit 108, a quantization unit 109, an inverse quantization unit 110, an inverse transformation unit 111, a second adder 112, a filtering unit 113, a decoded picture buffer (DPB) unit 114, and an entropy coding unit 115. Here, the input of the encoding device 100 may be a video consisting of a series of pictures or a single still image, and the output of the encoding device 100 may be a bitstream (also referred to as a "codestream") representing a compressed version of the input video.
[0099] Here, the division unit 101 divides a picture in the input video into one or more coding tree units (CTUs). The division unit 101 divides the picture into one or more blocks (or tiles), and may further divide one tile into one or more bricks, where one tile or one brick may include one or more complete and / or partial CTUs. The division unit 101 may also form one or more slices, where one slice may include one or more tiles arranged in raster order within the picture, or one or more tiles covering a rectangular area within the picture. The division unit 101 may further form one or more sub-pictures, where one sub-picture may include one or more slices, tiles, or bricks.
[0100] In the encoding process of the encoding device 100, the division unit 101 sends a CTU to the prediction unit 102. Typically, the prediction unit 102 may be composed of a block division unit 103, a motion estimation (ME) unit 104, a motion compensation (MC) unit 105, and an intra-frame prediction unit 106. Specifically, the block division unit 103 further divides the input CTU into smaller coding units (CUs) by repeatedly using quadtree division, binary tree division, and ternary tree division. The prediction unit 102 can obtain an inter-frame prediction block of the CU through the ME unit 104 and the MC unit 105. The intra-frame prediction unit 106 can obtain an intra-frame prediction block of the CU using various intra-frame prediction modes, including MIP mode. In one example, a rate-distortion optimized motion estimation scheme can be invoked by ME unit 104 and MC unit 105 to obtain inter-frame predicted blocks, and a rate-distortion optimized mode decision scheme can be invoked by intra-frame prediction unit 106 to obtain intra-frame predicted blocks.
[0101] The prediction unit 102 outputs a prediction block of the CU, and the first adder 107 calculates the difference between the CU in the output of the division unit 101 and the prediction block of the CU, i.e., a residual CU. The transform unit 108 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients. The quantization unit 109 quantizes the coefficients and outputs quantized coefficients (i.e., levels). The inverse quantization unit 110 performs a scaling operation on the quantized coefficients and outputs reconstructed coefficients. The inverse transform unit 111 performs one or more inverse transforms corresponding to the transform in the transform unit 108 and outputs a reconstructed residual. The second adder 112 calculates a reconstructed CU by adding the reconstructed residual and the prediction block of the CU from the prediction unit 102. The second adder 112 further sends its output to the prediction unit 102 as an intra-frame prediction reference. After all CUs in a picture or subpicture are reconstructed, the filtering unit 113 performs in-loop filtering on the reconstructed picture or subpicture. Here, the filtering unit 113 includes one or more filters, such as a deblocking filter, a Sample Adaptive Offset (SAO) filter, an Adaptive Loop Filter (ALF), a Luma Mapping with Chroma Scaling (LMCS) filter, and a filter based on a neural network, etc. Alternatively, the filtering unit 113 performs in-loop filtering on one or more target pixels in a CU when it determines that the CU will not be used as a reference in encoding other CUs.
[0102] The filtering unit 113 outputs decoded pictures or sub-pictures, which are cached in the DPB unit 114. The DPB unit 114 outputs the decoded pictures or sub-pictures based on timing and control information. Here, the pictures stored in the DPB unit 114 can also be used as references for the prediction unit 102 to perform inter-frame prediction or intra-frame prediction. Finally, the entropy coding unit 115 converts parameters (e.g., control parameters and supplemental information) required for the decoded pictures from the encoding device 100 into binary format and writes the binary format into a codestream according to the syntax structure of each data unit. That is, the encoding device 100 finally outputs a codestream.
[0103] Furthermore, the encoding device 100 may include a first processor and a first memory for storing a computer program. When the first processor reads and executes the computer program, the encoding device 100 reads the input video and generates a corresponding codestream. The encoding device 100 may also be a computing device including one or more chips. These units, implemented as integrated circuits on the chips, have the same connections and data exchange functions as the corresponding units in FIG. 8A.
[0104] 8B, which is a schematic diagram illustrating a system configuration of a decoding device according to an embodiment of the present application. As shown in FIG. 8B, the decoding device 200 may include a parsing unit 201, a prediction unit 202, an inverse quantization unit 205, an inverse transform unit 206, an adder 207, a filtering unit 208, and a decoded picture buffer unit 209. Here, the input of the decoding device 200 may be a bitstream representing a compressed version of a video or a single still image, and the output of the decoding device 200 may be a decoded video consisting of a series of pictures or a single decoded still image.
[0105] Here, the input codestream of the decoding device 200 may be the codestream generated by the encoding device 100. The parsing unit 201 parses the input codestream and obtains values of syntax elements from the input codestream. The parsing unit 201 converts binary representations of the syntax elements into numerical values and sends the numerical values to units in the decoding device 200 to obtain one or more decoded pictures. The parsing unit 201 may further parse one or more syntax elements from the input codestream to display the decoded pictures.
[0106] In the decoding process of the decoding device 200, the analysis unit 201 transmits the values of the syntax elements and one or more variables set or determined based on the values of the syntax elements to units within the decoding device 200 for obtaining one or more decoded pictures.
[0107] The prediction unit 202 determines a prediction block of a currently decoded block (such as a CU). Here, the prediction unit 202 may include a motion compensation unit 203 and an intra-frame prediction unit 204. Specifically, if an inter-frame decoding mode is indicated for decoding the currently decoded block, the prediction unit 202 transfers related parameters from the analysis unit 201 to the motion compensation unit 203 to obtain an inter-frame predicted block; if an intra-frame prediction mode (including a MIP mode indicated based on a MIP mode index value) is indicated for decoding the currently decoded block, the prediction unit 202 transfers related parameters from the analysis unit 201 to the intra-frame prediction unit 204 to obtain an intra-frame predicted block.
[0108] The inverse quantization unit 205 has similar functionality to the inverse quantization unit 110 in the encoding device 100. The inverse quantization unit 205 performs a scaling operation on the quantized coefficients (i.e., levels) from the analysis unit 201 to obtain reconstructed coefficients.
[0109] The inverse transform unit 206 has similar functions to the inverse transform unit 111 in the encoding device 100. The inverse transform unit 206 performs one or more transform operations (i.e., the inverse operations of the one or more transform operations performed by the inverse transform unit 111 in the encoding device 100) to obtain a reconstructed residual.
[0110] The adder 207 performs an addition operation on its inputs (the prediction block from the prediction unit 202 and the reconstructed residual from the inverse transform unit 206) to obtain a reconstructed block for the current decoded block, which is sent to the prediction unit 202 to be used as a reference for other blocks coded in intra-frame prediction mode.
[0111] After all CUs in a picture or subpicture are reconstructed, the filtering unit 208 performs in-loop filtering on the reconstructed picture or subpicture. The filtering unit 208 may include one or more filters, such as a deblocking filter, a sampling adaptive compensation filter, an adaptive in-loop filter, a luma mapping and chroma scale filter, and a filter based on a neural network. Alternatively, if the filtering unit 208 determines that the reconstructed block will not be used as a reference when decoding other blocks, it may perform in-loop filtering on one or more target pixels in the reconstructed block. Here, the output of the filtering unit 208 is a decoded picture or subpicture, which is cached in the DPB unit 209. The DPB unit 209 outputs the decoded picture or subpicture based on timing and control information. The picture stored in the DPB unit 209 may also be used as a reference for the prediction unit 202 to perform inter-frame prediction or intra-frame prediction.
[0112] Furthermore, the decoding device 200 may include a second processor and a second memory for storing a computer program. When the second processor reads and executes the computer program, the encoding device 200 reads the input codestream and generates a corresponding decoded video. The decoding device 200 may also be a computing device with one or more chips. These units, implemented as integrated circuits on the chips, have the same connections and data exchange functions as the corresponding units in FIG. 8B.
[0113] When the embodiment of the present application is applied to the encoding device 100, the "current block" specifically refers to the block currently to be encoded in the video image (which may also be called the "encoding block"), and when the embodiment of the present application is applied to the decoding device 200, the "current block" specifically refers to the block currently to be decoded in the video image (which may also be called the "decoding block").
[0114] In one embodiment of the present application, refer to Figure 9, which is a schematic diagram showing a system configuration of a decoding device according to an embodiment of the present application. As shown in Figure 9, the method may include the following steps:
[0115] In step S901, the codestream is analyzed to determine the component identification information of the current slice, and the coordinate information of the last non-zero coefficient of the current block corresponding to the component of the current slice.
[0116] It should be noted that the decoding method in the embodiment of the present application specifically refers to a coefficient decoding method applied to a decoding device. Here, based on the configuration of the decoding device 200 shown in Figure 8B, the decoding method is mainly applied to the "analysis unit 201" part in the decoding device 200, and the analysis unit 201 can adopt an adaptive binary arithmetic coding mode or a bypass mode based on a context model for decoding to obtain the value of related identification information (or syntax element), and further determine the coefficients of the current block.
[0117] Generally, encoding in a video standard may include encoding and decoding, and therefore, video encoding may include an encoding method on an encoding device side and a decoding method on a decoding device side. In the embodiment of the present application, a decoding method on a decoding device side will be described.
[0118] In general, for example, in the case of conventional video, the decoding method for coefficients is the same as the existing method in the prior art. However, in some cases, such as high bitwidth or high quality or high bitrate or lossless compression video codec, the embodiments of the present application provide a derivation scheme that can modify the position of the last non-zero coefficient.
[0119] In an embodiment of the present application, the component identification information of the current slice is a slice-level flag. The component identification information is used to indicate whether the component of the current slice uses last non-zero coefficient position inversion. Here, if the component of the current slice uses last non-zero coefficient position inversion, it means that the current block corresponding to the component of the current slice does not use last non-zero coefficient position inversion. If the component of the current slice does not use last non-zero coefficient position inversion, it means that the current block corresponding to the component of the current slice does not use last non-zero coefficient position inversion.
[0120] It can be appreciated that the current sequence may include a current slice, and the current slice may include a current block. In some embodiments, before parsing the codestream and determining the component identity of the current slice, the method may further include: Parsing the codestream to determine a first syntax element identification; If the first syntax element identification information indicates that the current sequence allows the use of last non-zero coefficient position inversion, performing a step of parsing the codestream and determining component identification information for the current slice may be included.
[0121] In an embodiment of the present application, the method may further include determining, if the value of the first syntax element identification information is a first value, that the first syntax element identification information indicates that the current sequence allows the use of last non-zero coefficient position inversion, or, if the value of the first syntax element identification information is a second value, that the first syntax element identification information indicates that the current sequence does not allow the use of last non-zero coefficient position inversion.
[0122] The first value is different from the second value, and the first value and the second value may be in a parameter format or in a numerical format. Specifically, the first syntax element identification information may be a parameter written in a profile or may be the value of one flag, and the embodiment of the present application is not limited thereto.
[0123] Taking the case where the first syntax element identification information is one flag as an example, in this case, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0, or the first value can be set to true and the second value can be set to false, or the first value can be set to 0 and the second value can be set to 1, or the first value can be set to false and the second value can be set to true. By way of example, for a flag, the first value can generally be 1 and the second value can be 0, but is not limited thereto.
[0124] TIFF2025163269000072.tif52170
[0125] Furthermore, before obtaining the first syntax element identification information by decoding, in one possible embodiment, the method comprises: Parsing the codestream to determine second syntax element identification information; If the second syntax element identification information indicates that the current sequence uses the standard extended version, the method may further include performing a step of parsing the codestream and determining the first syntax element identification information.
[0126] In another possible embodiment, before obtaining the first syntax element identification information by decoding, the method further comprises: Parsing the codestream to determine a third syntax element identification; If the third syntax element identification information indicates that the current sequence uses range extension, performing the step of parsing the codestream and determining the first syntax element identification information may further include:
[0127] In yet another possible embodiment, before obtaining the first syntax element identification information by decoding, the method further comprises: Parsing the codestream to determine second syntax element identification information; If the second syntax element identification information indicates that the current sequence uses the standard extended version, parsing the codestream to determine a third syntax element identification information; If the third syntax element identification information indicates that the current sequence uses range extension, performing the step of parsing the codestream and determining the first syntax element identification information may further include:
[0128] TIFF2025163269000073.tif44170
[0129] TIFF2025163269000074.tif134170
[0130] Further, in some embodiments, the method may further include determining that the second syntax element identification information indicates that the current sequence uses the standard extended version if the value of the second syntax element identification information is a first value, or determining that the second syntax element identification information indicates that the current sequence does not use the standard extended version if the value of the second syntax element identification information is a second value.
[0131] Further, in some embodiments, the method may further include determining that the third syntax element identification information indicates that the current sequence uses range extension if the value of the third syntax element identification information is a first value, or determining that the third syntax element identification information indicates that the current sequence does not use range extension if the value of the third syntax element identification information is a second value.
[0132] The first value may be different from the second value, and the first value and the second value may be in a parameter format or in a numerical format. In a specific example, the first value may be set to 1 and the second value may be set to 0, but this is not limiting.
[0133] TIFF2025163269000075.tif89170
[0134] In some embodiments, the current sequence using range extension may include the current sequence satisfying at least one of high bit width, high quality, high bit rate, high frame rate, and lossless compression.
[0135] That is, compared with conventional video, the video described in the embodiment of the present application has characteristics such as high bit width, high quality, high bit rate, high frame rate, and lossless compression.
[0136] Furthermore, the first syntax element identification information, the second syntax element identification information, and the third syntax element identification information may be sequence-level flags, or may even be higher-level flags such as Video Usability Information (VUI) and Supplemental Enhancement Information (SEI).
[0137] TIFF2025163269000076.tif62170
[0138] TIFF2025163269000077.tif43170
[0139] In one possible embodiment, if the third syntax element identification information is high bit width identification information, the method may further include determining that the current sequence uses range extension if the high bit width identification information indicates that the current sequence meets the high bit width.
[0140] In another possible embodiment, if the third syntax element identification information is high bit rate identification information, the method may further include determining that the current sequence uses range extension if the high bit rate identification information indicates that the current sequence meets the high bit rate.
[0141] In yet another possible embodiment, if the third syntax element identification information is high quality identification information, the method may further include determining that the current sequence uses range extension if the high quality identification information indicates that the current sequence meets high quality.
[0142] In yet another possible embodiment, if the third syntax element identification information is lossless compression identification information, the method may further include determining that the current sequence uses range extension if the lossless compression identification information indicates that the current sequence satisfies lossless compression.
[0143] TIFF2025163269000078.tif61170
[0144] Further, in some embodiments, for step S901, parsing the codestream and determining coordinate information of a last non-zero coefficient of a current block corresponding to a component of a current slice may include: Parsing the codestream to obtain last non-zero coefficient horizontal coordinate prefix information, last non-zero coefficient vertical coordinate prefix information, last non-zero coefficient horizontal coordinate suffix information, and last non-zero coefficient vertical coordinate suffix information of the current block; determining a horizontal coordinate of the last non-zero coefficient based on the prefix information of the horizontal coordinate of the last non-zero coefficient and the suffix information of the horizontal coordinate of the last non-zero coefficient; determining a vertical coordinate of the last non-zero coefficient based on the prefix information of the vertical coordinate of the last non-zero coefficient and the suffix information of the vertical coordinate of the last non-zero coefficient; and determining coordinate information of the last non-zero coefficient of the current block based on the horizontal coordinate of the last non-zero coefficient and the vertical coordinate of the last non-zero coefficient.
[0145] TIFF2025163269000079.tif99170
[0146] TIFF2025163269000080.tif34170
[0147] TIFF2025163269000081.tif53170
[0148] TIFF2025163269000082.tif53170
[0149] TIFF2025163269000083.tif25170
[0150] Note that the slice-level last non-zero coefficient position reversal identification information may also be referred to as the component identification information of the current slice. If the value of the component identification information is a first value, determine that the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion, or The method may further include determining, if the value of the component identification information is a second value, that the component identification information indicates that the component of the current slice does not use last non-zero coefficient position inversion.
[0151] The first value may be different from the second value, and the first value and the second value may be in a parameter format or in a numerical format. In a specific example, the first value may be set to 1 and the second value may be set to 0, but this is not limiting.
[0152] For example, if the first value is 1 and the second value is 0, it can be determined that if the value of the component identification information obtained by decoding is 1, it indicates that the component of the current slice uses the last non-zero coefficient position inversion, and if the value of the component identification information obtained by decoding is 0, it can be determined that it indicates that the component of the current slice does not use the last non-zero coefficient position inversion.
[0153] In step S902, if the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion, calculate the coordinate information of the last non-zero coefficient to obtain the position of the last non-zero coefficient of the current block.
[0154] In step S903, all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order are decoded to determine the coefficients of the current block.
[0155] It should be noted that in the embodiment of the present application, if the component identification information indicates that the component of the current slice uses the inverted last non-zero coefficient position, it means that the current block corresponding to the component of the current slice also uses the inverted last non-zero coefficient position, and in this case, the coordinate information of the last non-zero coefficient of the current block can be determined to be the horizontal and vertical distances between the position of the last non-zero coefficient and the bottom right corner position of the current block.
[0156] In some embodiments, calculating the coordinate information of the last non-zero coefficient to obtain the position of the last non-zero coefficient of the current block comprises: Determining the width and height of the current block; performing a subtraction calculation based on the width of the current block and the horizontal distance between the position of the last non-zero coefficient and the position of the bottom right corner of the current block to obtain the horizontal coordinate of the last non-zero coefficient; performing a subtraction calculation based on the height of the current block and the vertical distance between the position of the last non-zero coefficient and the position of the bottom right corner of the current block to obtain the vertical coordinate of the last non-zero coefficient; determining the location of the last non-zero coefficient of the current block based on the horizontal coordinate of the last non-zero coefficient and the vertical coordinate of the last non-zero coefficient.
[0157] The coordinate information of the last non-zero coefficient is usually the horizontal and vertical distances between the position of the last non-zero coefficient and the upper left corner of the current block. In conventional video, most of the non-zero coefficients are concentrated in the upper left corner, and a large area in the lower right corner is zero. However, in the case of a video codec with a high bit width, high quality, and high bit rate, a large number of non-zero coefficients also occur in the lower right corner, so the value of the coordinate information of the last non-zero coefficient is generally large. In this case, to reduce overhead, a coordinate transformation (specifically, a coordinate inversion calculation, i.e., the coordinate information of the last non-zero coefficient after coordinate inversion is the horizontal and vertical distances between the position of the last non-zero coefficient and the lower right corner of the current block) needs to be performed during coefficient encoding. Therefore, a coordinate inversion calculation is also required during coefficient decoding. After inversion again, the coordinate information of the last non-zero coefficient can be restored to the horizontal and vertical distances between the position of the last non-zero coefficient and the upper left corner of the current block. Thus, the position of the last non-zero coefficient is determined, and all coefficients before the position of the last non-zero coefficient in the current block are coded according to a predetermined scanning order.
[0158] TIFF2025163269000084.tif112170
[0159] Further, in some embodiments, the method further comprises: If the component identification information indicates that the component of the current slice does not use last non-zero coefficient position inversion, determining that the coordinate information of the last non-zero coefficient of the current block is the horizontal distance and vertical distance between the position of the last non-zero coefficient and the upper left corner position of the current block; determining a position of the last non-zero coefficient of the current block based on horizontal and vertical distances between the position of the last non-zero coefficient and a top left corner position of the current block.
[0160] If the component identification information indicates that the component of the current slice does not use the inversion of the last non-zero coefficient position, it means that the current block corresponding to the component of the current slice also does not use the inversion of the last non-zero coefficient position, and the coordinate information of the last non-zero coefficient obtained by decoding can be regarded as the target coordinate information of the last non-zero coefficient. In the embodiment of the present application, the target coordinate information of the last non-zero coefficient is the horizontal and vertical distances between the position of the last non-zero coefficient and the upper left corner of the current block.
[0161] Further, in some embodiments, the method further comprises: If the component identification information indicates that the component of the current slice does not use last non-zero coefficient position inversion, directly determining the position of the last non-zero coefficient of the current block based on the coordinate information of the last non-zero coefficient; and determining the coefficients of the current block by decoding all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order.
[0162] It should be noted that the predetermined scanning order may be diagonal, zigzag, horizontal, vertical, 4x4 sub-block scanning, or other scanning orders, and the embodiments of the present application are not limited thereto.
[0163] If the value of the component identification information of the current slice is 0 after obtaining the component identification information of the current slice, that is, if the component of the current slice needs to use the last non-zero coefficient position inversion, then the current block corresponding to the component of the current slice needs to obtain the coordinate information of the last non-zero coefficient by decoding, and then calculate the coordinate information of the last non-zero coefficient to determine the position of the last non-zero coefficient of the current block, and then decode all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order to obtain the coefficients of the current block. If the value of the component identification information of the current slice is 1, that is, if the component of the current slice does not need to use the last non-zero coefficient position inversion, then the current block corresponding to the component of the current slice needs to obtain the coordinate information of the last non-zero coefficient by decoding, and then directly determine the position of the last non-zero coefficient of the current block based on the coordinate information of the last non-zero coefficient, and then decode all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order to obtain the coefficients of the current block.
[0164] TIFF2025163269000085.tif197170
[0165] The semantic modifications are as follows:
[0166] TIFF2025163269000086.tif168170
[0167] TIFF2025163269000087.tif34170
[0168] TIFF2025163269000088.tif81170
[0169] TIFF2025163269000089.tif62170
[0170] TIFF2025163269000090.tif133170
[0171] In one implementation, the syntax element table is modified as shown in Table 3 (Sequence parameter set RBSP syntax).
[0172] [Table 3]
[0173] In another implementation, the syntax element table is modified as shown in Table 4 (Sequence parameter set range extension syntax).
[0174] [Table 4]
[0175] TIFF2025163269000093.tif35170
[0176] TIFF2025163269000094.tif61170
[0177] TIFF2025163269000095.tif216170
[0178] The flag for inverting the position of the last non-zero coefficient means "whether to permit use" at the sequence level, and means "determine whether to use" at the slice level.
[0179] In yet another implementation, the syntax element table is modified as shown in Table 5 (Slice header syntax).
[0180] [Table 5]
[0181] TIFF2025163269000097.tif44170
[0182] TIFF2025163269000098.tif43170
[0183] TIFF2025163269000099.tif25170
[0184] In an embodiment of the present application, the components may include a first image component, a second image component, and a third image component.
[0185] In a specific example, the first image component is a luminance component, the second image component is a first chromaticity component, and the third image component is a second chromaticity component, where the luminance component is represented by the Y component, the first chromaticity component is represented by the U(Cb) component, and the second chromaticity component is represented by the V(Cr) component.
[0186] In another specific example, the first image component is a red component, the second image component is a green component, and the third image component is a blue component, where the red component is represented by the R component, the green component is represented by the G component, and the blue component is represented by the B component.
[0187] Furthermore, in some embodiments, when the components include a first image component, a second image component, and a third image component, the method further comprises: determining whether common component identification information exists among the first image component, the second image component, and the third image component in the current slice based on attribute relationships among the first image component, the second image component, and the third image component; The method may further include determining the number of component identification information of the current slice based on the determination result, where the number of component identification information is one, two, or three.
[0188] Specifically, determining the number of component identifiers includes: If the first image component, the second image component, and the third image component of the current slice all share one component identification, determine that the number of component identifications of the current slice is one; or If two of the first image component, the second image component, and the third image component of the current slice share one component identity, determining that the number of component identities of the current slice is two; or The method may include determining that if the first image component, the second image component, and the third image component of the current slice each use one component identification, the number of component identifications of the current slice is three.
[0189] In the embodiment of the present application, on the one hand, since the attributes of each image component are different, the image components may be R, G, B in RGB format video or Y, U, V (Y, Cb, Cr) in YUV format, and other possible formats. The YUV format may include formats such as YUV444, YUV422, YUV420, etc. Since the human eye is more sensitive to changes in luminance than chrominance, chrominance in formats such as YUV422 and YUV420 may be downsampled. In addition, the quantization step length of chrominance is larger than that of luminance, which has the effect of reducing the bit rate.
[0190] On the other hand, some cross-component coding techniques improve coding efficiency by exploiting the correlation between each component. For example, the cross-component linear model (CCLM) predicts the chrominance component using a reconstructed value of the luma component and a linear model. CCLM improves the prediction accuracy of the chrominance component, thereby reducing the residual error of the chrominance component. Other techniques use information from the luma component and one chrominance component to predict another component, thereby further improving compression efficiency. The cross-component adaptive loop filter (CCALF) technique enhances compression efficiency by supplementing some luma component details with the chrominance component during in-loop filtering. Because the chrominance component details can be supplemented by the luma component, this can result in greater distortion in the coding residual.
[0191] Thus, due to the different attributes of each image component and the use of some cross-component techniques, the residual distribution laws of each image component are not always consistent. For example, in high-quality video codecs with high bit rates and high quality requirements, the distribution of non-zero coefficients of different components is similar, for example, non-zero coefficients are close to the lower right corner of the region where non-zero coefficients are likely to be present. However, in some video codecs with lower bit rates and lower quality requirements, the distribution of non-zero coefficients of different components may be different, for example, non-zero coefficients of the Y component are close to the lower right corner of the region where non-zero coefficients are likely to be present, while non-zero coefficients of the U / V components are only distributed in the upper left corner, or non-zero coefficients of the U component are also close to the lower right corner, while non-zero coefficients of the V component are only distributed in the upper left corner.
[0192] Therefore, in the present embodiment, one or more component identification information can be used to control the application of the present embodiment to different image components. For example, one component identification information can be used to control a flag to control whether the method of the present embodiment is applied to three image components. Alternatively, two component identification information can be used to control a flag to control whether the method of the present embodiment is applied to three image components. For example, one component identification information can be used to control the luminance component, and the other component identification information can be used to control the two chromaticity components. Alternatively, three component identification information can be used to control whether the method of the present embodiment is applied to each of the three image components. For example, the three image components can be R, G, and B of RGB, or Y, U, and V of YUV, or Y, Cb, and Cr.
[0193] In one possible embodiment, if the number of component identities is one, parsing the codestream and determining a component identity of the current slice includes parsing the codestream and determining a first component identity of the current slice; Correspondingly, the method may further include determining that when the value of the first component identification information is a first value, the first image component, the second image component, and the third image component of the current slice all use a last non-zero coefficient position inversion, or when the value of the first component identification information is a second value, determining that none of the first image component, the second image component, and the third image component of the current slice use a last non-zero coefficient position inversion.
[0194] In another possible embodiment, if the number of component identities is two, parsing the codestream to determine a component identity of the current slice includes parsing the codestream to determine a second component identity and a third component identity of the current slice; Correspondingly, the method includes determining that two image components among the first image component, the second image component, and the third image component of the current slice use last non-zero coefficient position inversion when the value of the second component identification information is a first value, or determining that two image components among the first image component, the second image component, and the third image component of the current slice do not use last non-zero coefficient position inversion when the value of the second component identification information is a second value; The method may further include determining that, if the value of the third component identification information is a first value, the remaining image components of the current slice, excluding the two image components, use last non-zero coefficient position inversion, or, if the value of the third component identification information is a second value, determining that the remaining image components of the current slice, excluding the two image components, use last non-zero coefficient position inversion.
[0195] In yet another possible embodiment, when the number of component identities is three, parsing the codestream to determine a component identity of the current slice includes parsing the codestream to determine a fourth component identity, a fifth component identity, and a sixth component identity of the current slice; Correspondingly, the method includes determining that the first image component of the current slice uses a last non-zero coefficient position inversion when the value of the fourth component identification information is a first value, or determining that the first image component of the current slice does not use a last non-zero coefficient position inversion when the value of the fourth component identification information is a second value; determining that the second image component of the current slice uses a last non-zero coefficient position inversion when the value of the fifth component identification information is a first value, or determining that the second image component of the current slice does not use a last non-zero coefficient position inversion when the value of the fifth component identification information is a second value; The method may further include determining that the third image component of the current slice uses last non-zero coefficient position inversion if the value of the sixth component identification information is a first value, or determining that the third image component of the current slice does not use last non-zero coefficient position inversion if the value of the sixth component identification information is a second value.
[0196] The first value may be different from the second value, and the first value and the second value may be in a parameter format or in a numerical format. In a specific example, the first value may be set to 1 and the second value may be set to 0, but this is not limiting.
[0197] TIFF2025163269000100.tif135170
[0198] TIFF2025163269000101.tif254170
[0199] In one possible embodiment, for the YUV format, the 0th component corresponds to the Y component, the 1st component corresponds to the U (Cb) component, and the 2nd component corresponds to the V (Cr) component.
[0200] In another possible embodiment, in the case of an RGB format, the 0th component corresponds to the R component, the 1st component corresponds to the G component, and the 2nd component corresponds to the B component.
[0201] TIFF2025163269000102.tif80170
[0202] [Table 6]
[0203] In another implementation, the syntax element table is modified as shown in Table 7 (Sequence parameter set range extension syntax).
[0204] [Table 7]
[0205] In yet another implementation, the syntax element table is modified as shown in Table 8 (Slice header syntax).
[0206] [Table 8]
[0207] In yet another implementation, there is another modification scheme for the Slice header syntax, and the syntax element table is modified as shown in Table 9 (Slice header syntax).
[0208] [Table 9]
[0209] Here, one possibility is that startComp is equal to 0 and numComps is equal to 3.
[0210] The semantic modifications are as follows:
[0211] TIFF2025163269000107.tif174170
[0212] TIFF2025163269000108.tif19170
[0213] Also, if the third syntax element identification information indicates that the current sequence uses range extension, by default, all coefficients that may need to be coded need to be coded, that is, all coefficients that may not be zero in the current block are scanned according to a predetermined scanning order, rather than using the position of the last non-zero coefficient. Therefore, the embodiment of the present application may also introduce a last coefficient enable identification information to determine whether the current block uses the last coefficient position.
[0214] In some embodiments, if the third syntax element identification information indicates that the current sequence uses range extension, the method further comprises: Parsing the codestream to determine a last coefficient enable identification for the current block; If the last coefficient enable identification information indicates that the current block uses the last coefficient position, decoding all coefficients before the last coefficient position according to a predetermined scanning order to determine the coefficients of the current block may be included.
[0215] TIFF2025163269000109.tif45170
[0216] TIFF2025163269000110.tif54170
[0217] In some embodiments, the method further comprises: If the value of the last coefficient enable identification information is a first value, determine that the last coefficient enable identification information indicates that the current block uses the last coefficient position; or The method may further include determining, if the value of the last coefficient enable identification information is the second value, that the last coefficient enable identification information indicates that the current block does not use the last coefficient position.
[0218] The first value may be different from the second value, and the first value and the second value may be in a parameter format or in a numerical format. In a specific example, the first value may be set to 1 and the second value may be set to 0, but this is not limiting.
[0219] TIFF2025163269000111.tif53170
[0220] If the current block uses the last coefficient position, all coefficients before the last coefficient position according to a predetermined scanning order can be decoded to further determine the coefficients of the current block.
[0221] Furthermore, if the current block does not use the last coefficient position, i.e., the value of the last coefficient enable identification is 0, in some embodiments, the method comprises: Parsing the codestream to obtain last non-zero coefficient horizontal coordinate prefix information, last non-zero coefficient vertical coordinate prefix information, last non-zero coefficient horizontal coordinate suffix information, and last non-zero coefficient vertical coordinate suffix information of the current block; determining a position of a last non-zero coefficient based on the prefix information of the horizontal coordinate of the last non-zero coefficient, the prefix information of the vertical coordinate of the last non-zero coefficient, the suffix information of the horizontal coordinate of the last non-zero coefficient, and the suffix information of the vertical coordinate of the last non-zero coefficient; The method may further include decoding all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order to determine the coefficients of the current block.
[0222] TIFF2025163269000112.tif80170
[0223] TIFF2025163269000113.tif72170
[0224] Here, the predetermined operation includes at least a zero-out operation.
[0225] TIFF2025163269000114.tif59170
[0226] In some particular examples, the position of the last non-zero coefficient is still used, in which case the position of the last non-zero coefficient may be located at the last position of all potentially non-zero coefficients in the current block in a given scanning order. When the position of the last non-zero coefficient is set to the last coefficient position, the method may further include determining the position of the last non-zero coefficient based on the coordinate information of the lower right corner of the transform block.
[0227] TIFF2025163269000115.tif76170
[0228] Thus, in some cases, when coefficients are coded, by default, all coefficients that may need to be coded are coded. That is, the coefficient coding method is usually the same as the existing method in the prior art. In some cases, for example, this may refer to a high-bitwidth, high-quality, or high-bitrate video codec or a lossless compression video codec. By default, all coefficients that may need to be coded are coded. That is, instead of using the position of the last non-zero coefficient, all coefficients that may be non-zero in the current block are scanned according to a predetermined scanning order, or the position of the last coefficient that needs to be coded is located at the last position of all coefficients that may be non-zero in the current block in the predetermined scanning order. This position usually refers to the lower right corner of a matrix consisting of all coefficients that may be non-zero in the current block. Here, the position of the last coefficient that needs to be coded is used instead of the position of the last non-zero coefficient. This is because the coefficient at the position of the last coefficient that needs to be coded may be zero, and the coefficient at the position of the last non-zero coefficient is not necessarily zero.
[0229] A special case is to still use the position of the last non-zero coefficient, in which case the position of the last non-zero coefficient is placed at the last position of all coefficients that can be zero in the current block for a given scan order.
[0230] It is also possible that the current block in a given scan order is not all zero, and in this case, in addition to the last non-zero coefficient, there are several other techniques that default certain coefficients in a block to zero, such as the zero-out technique mentioned above.
[0231] The semantic modifications are shown in Table 10.
[0232] [Table 10]
[0233] TIFF2025163269000117.tif72170
[0234] TIFF2025163269000118.tif53170
[0235] TIFF2025163269000119.tif86170
[0236] TIFF2025163269000120.tif77170
[0237] TIFF2025163269000121.tif52170
[0238] TIFF2025163269000122.tif44170
[0239] TIFF2025163269000123.tif118170
[0240] In implementation, the syntax element table is modified as shown in Table 11 (Sequence parameter set RBSP syntax).
[0241] [Table 11]
[0242] TIFF2025163269000125.tif117170
[0243] In implementation, the syntax element table is modified as shown in Table 12 (Slice header syntax).
[0244] [Table 12]
[0245] TIFF2025163269000127.tif24170
[0246] TIFF2025163269000128.tif122170
[0247] Here, in the present embodiment, one or more component identification information can be used to control the application of the present embodiment to different image components. For example, one component identification information can be used to control a flag to control whether the method of the present embodiment is applied to three image components. For example, one component identification information can be used to control whether the method of the present embodiment is applied to three image components. Alternatively, two component identification information can be used to control flags to control whether the method of the present embodiment is applied to three image components. For example, one component identification information can be used to control the luminance component, and the other component identification information can be used to control two chromaticity components. Alternatively, three component identification information can be used to control whether the method of the present embodiment is applied to each of the three image components. For example, the three image components can be R, G, and B of RGB, or Y, U, and V of YUV, or Y, Cb, and Cr.
[0248] TIFF2025163269000129.tif80170
[0249] TIFF2025163269000130.tif52170
[0250] In some embodiments, if the third syntax element identification information indicates that the current sequence uses range extension, the method further comprises: Parsing the codestream to determine sub-block default coding identification information for the current block; If the sub-block default coding identification information indicates that the sub-block to be decoded in the current block is coded by default, decoding all coefficients in the sub-block to be decoded may further be included.
[0251] In addition, if the sub-block default encoding identification information indicates that the sub-block to be decoded in the current block is encoded by default, the value of the sub-block default encoding identification information can be determined as the first value, in which case all coefficients in the sub-block to be decoded need to be decoded.
[0252] In addition, the sub-block default identification information can be represented by default_sb_coded_flag. In the embodiment of the present application, the sub-block default coding identification information may be identification information of at least one of a sequence level, an image level, a slice level, and a block level, or may even be identification information of a higher level (such as a VUI or SEI), and is not particularly limited here.
[0253] TIFF2025163269000131.tif51170
[0254] In some embodiments, the decoding method may further include determining, if the value of the sub-block default encoding identification information is a first value, that the sub-block default encoding identification information indicates that the sub-block to be decoded in the current block is encoded by default, or, if the value of the sub-block default encoding identification information is a second value, that the sub-block default encoding identification information indicates that the sub-block to be decoded in the current block is not encoded by default.
[0255] The first value is different from the second value, and the first value and the second value may be in a parameter format or in a numerical format. Specifically, the first syntax element identification information may be a parameter written in a profile or may be the value of one flag, and the embodiment of the present application is not limited thereto.
[0256] Taking the case where the first syntax element identification information is one flag as an example, in this case, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0, or the first value can be set to true and the second value can be set to false, or the first value can be set to 0 and the second value can be set to 1, or the first value can be set to false and the second value can be set to true, and there are no particular limitations here.
[0257] TIFF2025163269000132.tif52170
[0258] TIFF2025163269000133.tif35170
[0259] TIFF2025163269000134.tif52170
[0260] Note that if the sub-block to be decoded does not need to be coded by default, it needs to be decoded to obtain the sub-block coding identification information, and then based on the sub-block coding identification information, it is determined whether or not to decode all the coefficients in the sub-block to be decoded.
[0261] Furthermore, in the case of sub-block coding identification information, the method may further include determining to decode all coefficients in the sub-block to be decoded if the value of the sub-block coding identification information is a first value, or determining that all coefficients in the sub-block to be decoded are zero if the value of the sub-block coding identification information is a second value.
[0262] TIFF2025163269000135.tif54170
[0263] TIFF2025163269000136.tif90170
[0264] The semantic modifications are shown in Table 13.
[0265] [Table 13]
[0266] TIFF2025163269000138.tif45170
[0267] TIFF2025163269000139.tif54170
[0268] TIFF2025163269000140.tif35170
[0269] TIFF2025163269000141.tif116170
[0270] In implementation, the syntax element table is modified as shown in Table 14 (Sequence parameter set RBSP syntax).
[0271] [Table 14]
[0272] TIFF2025163269000143.tif118170
[0273] In implementation, the syntax element table is modified as shown in Table 15 (Slice header syntax).
[0274] [Table 15]
[0275] TIFF2025163269000145.tif54170
[0276] TIFF2025163269000146.tif27170
[0277] TIFF2025163269000147.tif115170
[0278] Here, in the present embodiment, one or more component identification information can be used to control the application of the present embodiment to different image components. For example, one component identification information can be used to control a flag to control whether the method of the present embodiment is applied to three image components. For example, one component identification information can be used to control whether the method of the present embodiment is applied to three image components. Alternatively, two component identification information can be used to control flags to control whether the method of the present embodiment is applied to three image components. For example, one component identification information can be used to control the luminance component, and the other component identification information can be used to control two chromaticity components. Alternatively, three component identification information can be used to control whether the method of the present embodiment is applied to each of the three image components. For example, the three image components can be R, G, and B of RGB, or Y, U, and V of YUV, or Y, Cb, and Cr.
[0279] TIFF2025163269000148.tif79170
[0280] In other words, for all image components in a video, a unified identification information can be used to control the application of the method of the present embodiment, or different identification information can be used to control the application of the method of the present embodiment to each image component individually, or two identification information can be used to control the application of the method of the present embodiment to all image components. That is, multiple identification information can be used to control the application of the method of the present embodiment to different image components. Here, all image components can refer to R, G, B in RGB format video, or Y, U, V (Y, Cb, Cr) in YUV format, etc.
[0281] This embodiment provides a decoding method applicable to a decoding device. The method analyzes a codestream to determine component identification information for a current slice, and determines coordinate information for the last non-zero coefficient of a current block corresponding to the component of the current slice. If the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion, the method calculates the coordinate information for the last non-zero coefficient to obtain the position of the last non-zero coefficient of the current block, and decodes all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order to determine the coefficients of the current block. In this way, in a video codec scenario with a high bit width, high bit rate, high quality, or lossless compression, by establishing a reasonable derivation method for the last non-zero coefficient according to the law of non-zero coefficient distribution, it is possible to reduce the encoding overhead in the codestream and improve compression efficiency. Furthermore, because the law of non-zero coefficient distribution for each image component is different, it is possible to more precisely control the derivation method for the last non-zero coefficient for each image component, i.e., to individually control whether each image component uses the last non-zero coefficient position inversion technique, thereby further improving compression efficiency.
[0282] In another embodiment of the present application, please refer to Figure 11, which is a flowchart of an encoding method according to an embodiment of the present application. As shown in Figure 11, the method may include the following steps:
[0283] In step S1101, the component identification information of the current slice is determined, and the position of the last non-zero coefficient of the current block corresponding to the component of the current slice is determined.
[0284] In step S1102, the coordinate information of the last non-zero coefficient of the current block is determined based on the component identification information and the position of the last non-zero coefficient.
[0285] In step S1103, all coefficients before the position of the last non-zero coefficient are coded according to a predetermined scanning order, and bit information, component identification information, and coordinate information of the last non-zero coefficient obtained by coding are written to the codestream.
[0286] The coding method in the embodiments of the present application specifically refers to a coefficient coding method applied to a coding device. Here, based on the structural structure of the coding device 100 shown in Figure 8A, the coding method is mainly applied to the "entropy coding unit 115" part in the coding device 100, and the entropy coding unit 115 can perform entropy coding on the associated identification information (or syntax element) using an adaptive binary arithmetic coding mode or a bypass mode based on a context model, and write the result into a codestream.
[0287] Generally, encoding in a video standard may include encoding and decoding, and therefore, video encoding may include an encoding method on an encoding device side and a decoding method on a decoding device side. In the embodiment of the present application, the encoding method on an encoding device side will be described.
[0288] Generally, for example, in the case of conventional video, the coding method for coefficients is the same as the existing method in the prior art. However, in some cases, such as high bit width, high quality, high bit rate, or lossless compression video codec, the embodiment of the present application provides a derivation method that can modify the position of the last non-zero coefficient. In this case, the embodiment of the present application needs to introduce component identification information to determine whether the component of the current slice uses the last non-zero coefficient position inversion.
[0289] In the present embodiment, the component identification information is a slice-level flag. The component identification information is used to indicate whether the component of the current slice uses last non-zero coefficient position inversion. Here, if the component of the current slice uses last non-zero coefficient position inversion, it means that the current block corresponding to the component of the current slice uses last non-zero coefficient position inversion. If the component of the current slice does not use last non-zero coefficient position inversion, it means that the current block corresponding to the component of the current slice does not use last non-zero coefficient position inversion.
[0290] As can be appreciated, the current sequence may include a current slice, and the current block may be included within the current slice. In some embodiments, before determining the component identity of the current slice, the method may further include: determining a first syntax element identification; If the first syntax element identification information indicates that the current sequence allows the use of last non-zero coefficient position inversion, performing a step of determining component identification information for the current slice.
[0291] In an embodiment of the present application, determining the first syntax element identification information may include determining the value of the first syntax element identification information as a first value if the current sequence allows the use of last non-zero coefficient position inversion, or determining the value of the first syntax element identification information as a second value if the current sequence does not allow the use of last non-zero coefficient position inversion.
[0292] Additionally, the encoding method may further include writing the first syntax element identification information into the codestream.
[0293] The first value is different from the second value, and the first value and the second value may be in a parameter format or in a numerical format. Specifically, the first syntax element identification information may be a parameter written in a profile or may be the value of one flag, and the embodiment of the present application is not limited thereto.
[0294] Taking the case where the first syntax element identification information is one flag as an example, in this case, for the first value and the second value, the first value can be set to 1 and the second value can be set to 0, or the first value can be set to true and the second value can be set to false, or the first value can be set to 0 and the second value can be set to 1, or the first value can be set to false and the second value can be set to true. By way of example, for a flag, the first value can generally be 1 and the second value can be 0, but is not limited thereto.
[0295] TIFF2025163269000149.tif52170
[0296] Furthermore, before obtaining the first syntax element identification information by decoding, in one possible embodiment, the method comprises: Parsing the codestream to determine second syntax element identification information; If the second syntax element identification information indicates that the current sequence uses the standard extended version, the method may further include performing a step of parsing the codestream and determining the first syntax element identification information.
[0297] In another possible embodiment, before obtaining the first syntax element identification information by decoding, the method further comprises: Parsing the codestream to determine a third syntax element identification; If the third syntax element identification information indicates that the current sequence uses range extension, performing the step of parsing the codestream and determining the first syntax element identification information may further include:
[0298] In yet another possible embodiment, before obtaining the first syntax element identification information by decoding, the method further comprises: Parsing the codestream to determine second syntax element identification information; If the second syntax element identification information indicates that the current sequence uses the standard extended version, parsing the codestream to determine a third syntax element identification information; If the third syntax element identification information indicates that the current sequence uses range extension, performing the step of parsing the codestream and determining the first syntax element identification information may further include:
[0299] TIFF2025163269000150.tif44170
[0300] TIFF2025163269000151.tif116170
[0301] In an embodiment of the present application, determining the second syntax element identification information may include determining the value of the second syntax element identification information as a first value if the current sequence uses the standard extended version, or determining the value of the second syntax element identification information as a second value if the current sequence does not use the standard extended version.
[0302] Additionally, the method may further include writing second syntax element identification information into the codestream.
[0303] In an embodiment of the present application, determining the third syntax element identification information may include determining the value of the third syntax element identification information as a first value if the current sequence uses range extension, or determining the value of the third syntax element identification information as a second value if the current sequence does not use range extension.
[0304] Additionally, the method may further include writing third syntax element identification information into the codestream.
[0305] The first value may be different from the second value, and the first value and the second value may be in a parameter format or in a numerical format. In a specific example, the first value may be set to 1 and the second value may be set to 0, but this is not limiting.
[0306] TIFF2025163269000152.tif88170
[0307] In some embodiments, the current sequence using range extension may include the current sequence satisfying at least one of high bit width, high quality, high bit rate, high frame rate, and lossless compression. Four cases are described below as examples.
[0308] In one possible embodiment, if the third syntax element identification information is high bit width identification information, the method may further include determining that the current sequence uses range extension if the high bit width identification information indicates that the current sequence meets the high bit width.
[0309] In another possible embodiment, if the third syntax element identification information is high bit rate identification information, the method may further include determining that the current sequence uses range extension if the high bit rate identification information indicates that the current sequence meets the high bit rate.
[0310] In yet another possible embodiment, if the third syntax element identification information is high quality identification information, the method may further include determining that the current sequence uses range extension if the high quality identification information indicates that the current sequence meets high quality.
[0311] In yet another possible embodiment, if the third syntax element identification information is lossless compression identification information, the method may further include determining that the current sequence uses range extension if the lossless compression identification information indicates that the current sequence satisfies lossless compression.
[0312] TIFF2025163269000153.tif61169
[0313] In an embodiment of the present application, the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, etc. may be sequence-level flags, or may further be higher-level flags such as Video Usability Information (VUI) and Supplemental Enhancement Information (SEI).
[0314] TIFF2025163269000154.tif54169
[0315] TIFF2025163269000155.tif52169
[0316] TIFF2025163269000156.tif26169
[0317] Note that the slice-level last non-zero coefficient position inversion identification information may also be referred to as the component identification information of the current slice. In some embodiments, determining the component identification information of the current slice may include: If the component of the current slice uses the last non-zero coefficient position inversion, determine the value of the component identity as the first value; or If the component of the current slice does not use a last non-zero coefficient inversion, the method may include determining the value of the component identity as a second value.
[0318] The first value may be different from the second value, and the first value and the second value may be in a parameter format or in a numerical format. In a specific example, the first value may be set to 1 and the second value may be set to 0, but this is not limiting.
[0319] Taking the case where the first value is 1 and the second value is 0 as an example, if the component of the current slice uses the last non-zero coefficient position inversion, that is, if the current block corresponding to the component of the current slice to which it belongs uses the last non-zero coefficient position inversion, the value of the component identification information can be determined to be 1; if the component of the current slice does not use the last non-zero coefficient position inversion, that is, the current block corresponding to the component of the current slice to which it belongs also does not use the last non-zero coefficient position inversion, the value of the component identification information can be determined to be 0.
[0320] Furthermore, for the current block corresponding to the component of the current slice to which it belongs, the location of the last non-zero coefficient may include an initial horizontal coordinate and an initial vertical coordinate of the last non-zero coefficient. When the initial horizontal coordinate sum is the horizontal distance and the vertical distance between the location of the last non-zero coefficient and the upper left corner position of the current block, determining the coordinate information of the last non-zero coefficient of the current block based on the component identification information and the location of the last non-zero coefficient may include: If the value of the component identification information is the first value, determine the coordinate information of the last non-zero coefficient by calculating it based on the initial horizontal coordinate and the initial vertical coordinate of the last non-zero coefficient; or When the value of the component identification information is the second value, the method may include directly determining the coordinate information of the last non-zero coefficient based on the initial horizontal coordinate and the initial vertical coordinate of the last non-zero coefficient.
[0321] In other words, in some embodiments, the method comprises: If the value of the component identification information is a first value, determine that the coordinate information of the last non-zero coefficient is the horizontal distance and vertical distance between the position of the last non-zero coefficient and the position of the bottom right corner of the current block; or If the value of the component identification information is a second value, the method may further include determining that the coordinate information of the last non-zero coefficient is the horizontal distance and vertical distance between the position of the last non-zero coefficient and the top-left corner position of the current block.
[0322] That is, the coordinate information of the last non-zero coefficient is usually the horizontal and vertical distances between the position of the last non-zero coefficient and the upper left corner of the current block. In conventional video, most of the non-zero coefficients are concentrated in the upper left corner, and a large area in the lower right corner is zero. However, in the case of a video codec with a high bit width, high quality, and high bit rate, a large number of non-zero coefficients also occur in the lower right corner, so the value of the coordinate information of the last non-zero coefficient is generally large. In this case, to reduce overhead, it is necessary to perform coordinate transformation during coefficient encoding (specifically, coordinate inversion calculation, i.e., the coordinate information of the last non-zero coefficient after coordinate inversion is the horizontal and vertical distances between the position of the last non-zero coefficient and the lower right corner of the current block). Thereafter, the decoding device also needs to perform coordinate inversion calculation during coefficient decoding. After inversion again, the coordinate information of the last non-zero coefficient can be restored to the horizontal and vertical distances between the position of the last non-zero coefficient and the upper left corner of the current block, thereby determining the position of the last non-zero coefficient.
[0323] Furthermore, in some embodiments, determining the coordinate information of the last non-zero coefficient by calculation based on the initial horizontal coordinate and the initial vertical coordinate of the last non-zero coefficient includes: Determining the width and height of the current block; performing a subtraction calculation based on the width of the current block and the initial horizontal coordinate of the last non-zero coefficient to obtain the horizontal coordinate of the last non-zero coefficient; performing a subtraction calculation based on the height of the current block and the initial vertical coordinate of the last non-zero coefficient to obtain the vertical coordinate of the last non-zero coefficient; and determining coordinate information of the last non-zero coefficient based on the horizontal coordinate of the last non-zero coefficient and the vertical coordinate of the last non-zero coefficient.
[0324] TIFF2025163269000157.tif113170
[0325] In some embodiments, writing the coordinate information of the last non-zero coefficient into the codestream comprises: Determining last non-zero coefficient horizontal coordinate prefix information, last non-zero coefficient vertical coordinate prefix information, last non-zero coefficient horizontal coordinate suffix information, and last non-zero coefficient vertical coordinate suffix information of the current block based on the coordinate information of the last non-zero coefficient; and writing the last non-zero coefficient horizontal coordinate prefix information, the last non-zero coefficient vertical coordinate prefix information, the last non-zero coefficient horizontal coordinate suffix information, and the last non-zero coefficient vertical coordinate suffix information into a codestream.
[0326] TIFF2025163269000158.tif62170
[0327] In the embodiment of the present application, the predetermined scanning order may be diagonal, zigzag, horizontal, vertical, 4x4 sub-block scanning or other scanning order, and the embodiment of the present application is not limited thereto.
[0328] TIFF2025163269000159.tif154170
[0329] TIFF2025163269000160.tif24170
[0330] In an embodiment of the present application, the components may include a first image component, a second image component, and a third image component.
[0331] In a specific example, the first image component is a luminance component, the second image component is a first chromaticity component, and the third image component is a second chromaticity component, where the luminance component is represented by the Y component, the first chromaticity component is represented by the U(Cb) component, and the second chromaticity component is represented by the V(Cr) component.
[0332] In another specific example, the first image component is a red component, the second image component is a green component, and the third image component is a blue component, where the red component is represented by the R component, the green component is represented by the G component, and the blue component is represented by the B component.
[0333] Furthermore, in some embodiments, when the components include a first image component, a second image component, and a third image component, the method further comprises: determining whether common component identification information exists among the first image component, the second image component, and the third image component in the current slice based on attribute relationships among the first image component, the second image component, and the third image component; The method may further include determining the number of component identification information of the current slice based on the determination result, where the number of component identification information is one, two, or three.
[0334] Specifically, determining the number of component identifiers includes: If the first image component, the second image component, and the third image component of the current slice all share one component identification, determine that the number of component identifications of the current slice is one; or If two of the first image component, the second image component, and the third image component of the current slice share one component identity, determining that the number of component identities of the current slice is two; or The method may include determining that if the first image component, the second image component, and the third image component of the current slice each use one component identification, the number of component identifications of the current slice is three.
[0335] In the embodiment of the present application, due to the different attributes of each image component and the use of some cross-component techniques, the residual distribution laws of each image component are not always consistent. For example, in a high-bitrate, high-quality video codec, the distribution of non-zero coefficients of different components is similar, for example, the non-zero coefficients are close to the lower right corner of the region where non-zero coefficients may be present. However, in some video codecs with lower bitrates and lower quality requirements, the distribution of non-zero coefficients of different components may be different, for example, the non-zero coefficients of the Y component are close to the lower right corner of the region where non-zero coefficients may be present, while the non-zero coefficients of the U / V components are only distributed at the upper left corner; or the non-zero coefficients of the U component are also close to the lower right corner, while the non-zero coefficients of the V component are only distributed at the upper left corner.
[0336] Therefore, in the present embodiment, one or more component identification information can be used to control the application of the present embodiment to different image components. For example, one component identification information can be used to control a flag to control whether the method of the present embodiment is applied to three image components. Alternatively, two component identification information can be used to control a flag to control whether the method of the present embodiment is applied to three image components. For example, one component identification information can be used to control the luminance component, and the other component identification information can be used to control the two chromaticity components. Alternatively, three component identification information can be used to control whether the method of the present embodiment is applied to each of the three image components. For example, the three image components can be R, G, and B of RGB, or Y, U, and V of YUV, or Y, Cb, and Cr.
[0337] In one possible embodiment, when the number of component identities is one, determining the component identity of the current slice may include determining a first component identity of the current slice; Correspondingly, the method may further include determining that when the value of the first component identification information is a first value, the first image component, the second image component, and the third image component of the current slice all use a last non-zero coefficient position inversion, or when the value of the first component identification information is a second value, determining that none of the first image component, the second image component, and the third image component of the current slice use a last non-zero coefficient position inversion.
[0338] In another possible embodiment, when the number of component identities is two, determining the component identity of the current slice may include determining a second component identity and a third component identity of the current slice; Correspondingly, the method includes determining that two image components of the current slice use last non-zero coefficient position inversion when the value of the second component identification information is a first value, or determining that neither of the two image components of the current slice uses last non-zero coefficient position inversion when the value of the second component identification information is a second value; The method may further include determining that, if the value of the third component identification information is a first value, the remaining image components of the current slice, excluding the two image components, use last non-zero coefficient position inversion, or, if the value of the third component identification information is a second value, determining that the remaining image components of the current slice, excluding the two image components, use last non-zero coefficient position inversion.
[0339] In yet another possible embodiment, when the number of component identities is three, determining the component identity of the current slice may include determining a fourth component identity, a fifth component identity, and a sixth component identity of the current slice; Correspondingly, the method includes determining that the first image component of the current slice uses a last non-zero coefficient position inversion when the value of the fourth component identification information is a first value, or determining that the first image component of the current slice does not use a last non-zero coefficient position inversion when the value of the fourth component identification information is a second value; determining that the second image component of the current slice uses a last non-zero coefficient position inversion when the value of the fifth component identification information is a first value, or determining that the second image component of the current slice does not use a last non-zero coefficient position inversion when the value of the fifth component identification information is a second value; The method may further include determining that the third image component of the current slice uses last non-zero coefficient position inversion if the value of the sixth component identification information is a first value, or determining that the third image component of the current slice does not use last non-zero coefficient position inversion if the value of the sixth component identification information is a second value.
[0340] The first value may be different from the second value, and the first value and the second value may be in a parameter format or in a numerical format. In a specific example, the first value may be set to 1 and the second value may be set to 0, but this is not limiting.
[0341] TIFF2025163269000161.tif134170
[0342] TIFF2025163269000162.tif80170
[0343] Also, if the third syntax element identification information indicates that the current sequence uses range extension, by default, all coefficients that may need to be coded need to be coded, that is, all coefficients that may not be zero in the current block are scanned according to a predetermined scanning order, rather than using the position of the last non-zero coefficient. Therefore, the embodiment of the present application may also introduce a last coefficient enable identification information to determine whether the current block uses the last coefficient position.
[0344] In some embodiments, if the third syntax element identification information indicates that the current sequence uses range extension, the method further comprises: determining a last coefficient enable identification for the current block; If the last coefficient enable identification information indicates that the current block uses the last coefficient position, the method may further include encoding all coefficients before the last coefficient position according to a predetermined scanning order, and writing bit information obtained by encoding and the last coefficient enable identification information into the codestream.
[0345] TIFF2025163269000163.tif44170
[0346] Note that in the case of a last coefficient enable identification, in some embodiments, determining the last coefficient enable identification of the current block comprises: If the current block uses the last coefficient position, determining the value of the last coefficient enable identification information as the first value; or The last coefficient position not used in the current block may include determining the value of the last coefficient enable identification information as a second value.
[0347] TIFF2025163269000164.tif33170
[0348] Furthermore, with respect to the last coefficient position, in some embodiments, the last coefficient position is the bottom right corner position of a matrix consisting of all potentially non-zero coefficients in the current block, or the last coefficient position is the last position in the current block where a scan of all potentially non-zero coefficients is performed according to a predetermined scan order.
[0349] Note that the last coefficient position in the present embodiment does not represent the position of the last non-zero coefficient, because the coefficient at the last coefficient position may be 0, and the coefficient at the position of the last non-zero coefficient is not necessarily 0.
[0350] In some particular examples, the method may further include setting a position of a last non-zero coefficient to the last coefficient position.
[0351] That is, embodiments of the present application can still use the position of the last non-zero coefficient, which in this case must be located at the last position of all potentially non-zero coefficients in the current block in a given scanning order.
[0352] TIFF2025163269000165.tif79170
[0353] Here, the predetermined operation includes at least a zero-out operation.
[0354] TIFF2025163269000166.tif58170
[0355] In some particular examples, the position of the last non-zero coefficient is still used, in which case the position of the last non-zero coefficient may be located at the last position of all coefficients that may be zero in the current block in a given scan order. When the position of the last non-zero coefficient is set to the last coefficient position, the method may further include determining the position of the last non-zero coefficient based on coordinate information of the lower right corner of the transform block.
[0356] TIFF2025163269000167.tif72170
[0357] Furthermore, if the last coefficient enable identification indicates that the current block does not use the last coefficient position, i.e., if the value of the last coefficient enable identification is 0, in some embodiments, the method comprises: Determining a last non-zero coefficient horizontal coordinate prefix information, a last non-zero coefficient vertical coordinate prefix information, a last non-zero coefficient horizontal coordinate suffix information, and a last non-zero coefficient vertical coordinate suffix information of the current block; determining a position of the last non-zero coefficient based on the horizontal coordinate prefix information of the last non-zero coefficient, the vertical coordinate prefix information of the last non-zero coefficient, the horizontal coordinate suffix information of the last non-zero coefficient, and the vertical coordinate suffix information of the last non-zero coefficient; The method may further include encoding all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, and writing prefix information of a horizontal coordinate of the last non-zero coefficient, prefix information of a vertical coordinate of the last non-zero coefficient, suffix information of a horizontal coordinate of the last non-zero coefficient, and suffix information of a vertical coordinate of the last non-zero coefficient into a codestream.
[0358] TIFF2025163269000168.tif42170
[0359] TIFF2025163269000169.tif115170
[0360] TIFF2025163269000170.tif27170
[0361] TIFF2025163269000171.tif124170
[0362] Here, in the embodiment of the present application, one or more component identification information can be used to control the application of the embodiment of the present application to different image components. For example, one component identification information can be used to control a flag to control whether the method of the embodiment of the present application is applied to three image components, or two component identification information can be used to control a flag to control whether the method of the embodiment of the present application is applied to three image components, or three component identification information can be used to control whether each of the three image components is applied to each of the three image components.
[0363] TIFF2025163269000172.tif79170
[0364] TIFF2025163269000173.tif53169
[0365] In some embodiments, if the third syntax element identification information indicates that the current sequence uses range extension, the method further comprises: determining sub-block default coding identification information of a sub-block to be coded within a current block; If the sub-block default coding identification information indicates that the sub-block to be coded is to be coded by default, the method may further include coding all coefficients in the sub-block to be coded, and writing bit information obtained by the coding and the sub-block default coding identification information into the code stream.
[0366] TIFF2025163269000174.tif42168
[0367] In addition, in the case of sub-block default identification information, in some embodiments, determining the sub-block default coding identification information of the sub-block to be coded may include determining the value of the sub-block default coding identification information as a first value if the sub-block to be coded is coded by default, or determining the value of the sub-block default coding identification information as a second value if the sub-block to be coded is not coded by default.
[0368] TIFF2025163269000175.tif34170
[0369] TIFF2025163269000176.tif62170
[0370] Furthermore, in some embodiments, determining the sub-block coding identification information of the sub-block to be coded may include determining the value of the sub-block coding identification information as a first value if coding is required within the sub-block, or determining the value of the sub-block coding identification information as a second value if all coefficients within the sub-block are zero.
[0371] TIFF2025163269000177.tif53170
[0372] TIFF2025163269000178.tif79170
[0373] TIFF2025163269000179.tif24170
[0374] TIFF2025163269000180.tif117170
[0375] Here, in the embodiment of the present application, one or more component identification information can be used to control the application of the embodiment of the present application to different image components. For example, one component identification information can be used to control a flag to control whether the method of the embodiment of the present application is applied to three image components, or two component identification information can be used to control a flag to control whether the method of the embodiment of the present application is applied to three image components, or three component identification information can be used to control whether each of the three image components is applied to each of the three image components.
[0376] TIFF2025163269000181.tif90170
[0377] In other words, for all image components in a video, a unified identification information can be used to control the application of the method of the present embodiment, or different identification information can be used to control the application of the method of the present embodiment to each image component individually, or two identification information can be used to control the application of the method of the present embodiment to all image components. That is, multiple identification information can be used to control the application of the method of the present embodiment to different image components. Here, all image components can refer to R, G, B in RGB format video, or Y, U, V (Y, Cb, Cr) in YUV format, etc.
[0378] An embodiment of the present application provides an encoding method applicable to an encoding device. The method determines the location of the last non-zero coefficient of a current block corresponding to a component of the current slice by determining component identification information of the current slice. Then, it determines coordinate information of the last non-zero coefficient of the current block based on the component identification information and the location of the last non-zero coefficient. Then, it encodes all coefficients before the location of the last non-zero coefficient according to a predetermined scanning order. The bit information, component identification information, and coordinate information of the last non-zero coefficient obtained by encoding are written into a codestream. In this way, in a video codec scenario with a high bit width, high bit rate, high quality, or lossless compression, a reasonable derivation method of the last non-zero coefficient according to the law of non-zero coefficient distribution can be established to reduce the encoding overhead in the codestream and improve compression efficiency. Furthermore, because the law of non-zero coefficient distribution differs for each image component, it is possible to more precisely control the derivation method of the last non-zero coefficient for each image component, i.e., to individually control whether each image component uses the last non-zero coefficient position inversion technique, thereby further improving compression efficiency.
[0379] In yet another embodiment of the present application, an embodiment of the present application provides a codestream, wherein the codestream may be generated by performing bit encoding based on encoding target information, wherein the encoding target information includes at least one of first syntax element identification information, second syntax element identification information, third syntax element identification information, component identification information, last coefficient enable identification information, and sub-block default encoding identification information; The first syntax element identification information is used to indicate whether the current sequence allows the use of last non-zero coefficient position inversion, the second syntax element identification information is used to indicate whether the current sequence uses the standard extended version, the third syntax element identification information is used to indicate whether the current sequence uses range extension, the component identification information is used to indicate whether the component of the current slice uses last non-zero coefficient position inversion, the last coefficient enable identification information is used to indicate whether the current block uses the last coefficient position, the sub-block default coding identification information is used to indicate whether the sub-block to be coded in the current block is coded by default, the current sequence includes the current slice, and the current slice includes the current block.
[0380] An embodiment of the present application further provides a codec system, which may include an encoding device and a decoding device, where the encoding device generates a codestream and then transmits the codestream to a decoding device, so that the decoding device analyzes the codestream to obtain related decoding information, such as first syntax element identification information, second syntax element identification information, third syntax element identification information, component identification information, last coefficient enable identification information, sub-block default coding identification information, and coordinate information of the last non-zero coefficient of a current block.
[0381] In another embodiment of the present application, based on the same inventive concept as the above-mentioned embodiment, Figure 12 is a schematic diagram showing the structure of an encoding device 120 according to the embodiment of the present application. As shown in Figure 12, the encoding device 120 may include a first determination unit 1201 and an encoding unit 1202; The first determining unit 1201 is configured to determine component identification information of a current slice, and determine a position of a last non-zero coefficient of a current block corresponding to the component of the current slice; The first determining unit 1201 is further configured to determine, according to the component identification information and the position of the last non-zero coefficient, coordinate information of the last non-zero coefficient of the current block; The encoding unit 1202 is configured to encode all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, and write bit information, component identification information, and coordinate information of the last non-zero coefficient obtained by the encoding into a codestream.
[0382] In some embodiments, the first determining unit 1201 is further configured to perform the steps of determining first syntax element identification information, and if the first syntax element identification information indicates that the current sequence allows the use of last non-zero coefficient position inversion, determining component identification information of a current slice, wherein the current sequence includes the current slice.
[0383] In some embodiments, the first determining unit 1201 is further configured to perform the steps of determining a second syntax element identification information, determining a third syntax element identification information if the second syntax element identification information indicates that the current sequence uses the standard extended version, and determining a first syntax element identification information if the third syntax element identification information indicates that the current sequence uses a range extension.
[0384] In some embodiments, the first determining unit 1201 further determines a value of the second syntax element identification information as a first value if the current sequence uses the standard extended version, or determines a value of the second syntax element identification information as a first value if the current sequence does not use the standard extended version. The second value is configured to determine the value as the second value.
[0385] In some embodiments, encoding unit 1202 is further configured to write second syntax element identification information into the codestream.
[0386] In some embodiments, the first determining unit 1201 is further configured to determine the value of the third syntax element identification information as a first value if the current sequence uses range extension, or to determine the value of the third syntax element identification information as a second value if the current sequence does not use range extension.
[0387] In some embodiments, encoding unit 1202 is further configured to write third syntax element identification information into the codestream.
[0388] In some embodiments, the current sequence using range extension includes the current sequence satisfying at least one of high bit width, high quality, high bit rate, high frame rate, and lossless compression.
[0389] In some embodiments, the first determining unit 1201 is further configured to determine the value of the first syntax element identification information as a first value if the current sequence allows the use of last non-zero coefficient position inversion, or to determine the value of the first syntax element identification information as a second value if the current sequence does not allow the use of last non-zero coefficient position inversion.
[0390] In some embodiments, encoding unit 1202 is further configured to write the first syntax element identification information into the codestream.
[0391] In some embodiments, the first determining unit 1201 is further configured to determine the value of the component identification information as a first value if the component of the current slice uses last non-zero coefficient position inversion, or to determine the value of the component identification information as a second value if the component of the current slice does not use last non-zero coefficient position inversion.
[0392] In some embodiments, the components include at least one of a first image component, a second image component, and a third image component; the first image component is a luminance component, the second image component is a first chrominance component, and the third image component is a second chrominance component; or The first image component is a red component, the second image component is a green component, and the third image component is a blue component.
[0393] In some embodiments, the first determining unit 1201 is further configured to: determine that, when the components include a first image component, a second image component, and a third image component, if the first image component, the second image component, and the third image component of the current slice all share one component identification information, the number of component identification information of the current slice is one; or determine that the number of component identification information of the current slice is two if two of the first image component, the second image component, and the third image component of the current slice share one component identification information; or determine that the number of component identification information of the current slice is three if the first image component, the second image component, and the third image component of the current slice each use one component identification information.
[0394] In some embodiments, the first determining unit 1201 is further configured to determine a first component identity of the current slice; Correspondingly, the first determination unit 1201 is further configured to determine the value of the first component identification information as a first value if the first image component, the second image component, and the third image component of the current slice all use last non-zero coefficient position inversion.
[0395] In some embodiments, the first determining unit 1201 is further configured to determine a second component identity and a third component identity of the current slice; Correspondingly, the first determination unit 1201 is further configured to determine the value of the second component identification information as a first value if two image components among the first image component, the second image component, and the third image component of the current slice use last non-zero coefficient position inversion, and to determine the value of the third component identification information as a first value if the remaining image components excluding the two image components of the current slice use last non-zero coefficient position inversion.
[0396] In some embodiments, the first determining unit 1201 is further configured to determine a fourth component identity, a fifth component identity, and a sixth component identity of the current slice; Correspondingly, the first determining unit 1201 is further configured to determine the value of the fourth component identification information as a first value if the first image component of the current slice uses last non-zero coefficient position inversion, determine the value of the fifth component identification information as the first value if the second image component of the current slice uses last non-zero coefficient position inversion, and determine the value of the sixth component identification information as the first value if the third image component of the current slice uses last non-zero coefficient position inversion.
[0397] In some embodiments, the location of the last non-zero coefficient includes an initial horizontal coordinate and an initial vertical coordinate of the last non-zero coefficient, the initial horizontal coordinate and the initial vertical coordinate being the horizontal distance and the vertical distance between the location of the last non-zero coefficient and the top left corner position of the current block; Correspondingly, the first determining unit 1201 is further configured to determine the coordinate information of the last non-zero coefficient by calculating based on the initial horizontal coordinate and the initial vertical coordinate of the last non-zero coefficient when the value of the component identification information is a first value, or to directly determine the coordinate information of the last non-zero coefficient based on the initial horizontal coordinate and the initial vertical coordinate of the last non-zero coefficient when the value of the component identification information is a second value.
[0398] In some embodiments, the first determining unit 1201 is further configured to determine a width and a height of the current block, perform a subtraction calculation based on the width of the current block and the initial horizontal coordinate of the last non-zero coefficient to obtain the horizontal coordinate of the last non-zero coefficient, perform a subtraction calculation based on the height of the current block and the initial vertical coordinate of the last non-zero coefficient to obtain the vertical coordinate of the last non-zero coefficient, and determine the coordinate information of the last non-zero coefficient based on the horizontal coordinate of the last non-zero coefficient and the vertical coordinate of the last non-zero coefficient.
[0399] In some embodiments, the first determining unit 1201 is further configured to determine, when the value of the component identification information is a first value, that the coordinate information of the last non-zero coefficient is the horizontal distance and vertical distance between the position of the last non-zero coefficient and the position of the bottom right corner of the current block; or, when the value of the component identification information is a second value, that the coordinate information of the last non-zero coefficient is the horizontal distance and vertical distance between the position of the last non-zero coefficient and the position of the top left corner of the current block.
[0400] In some embodiments, the first determining unit 1201 is further configured to determine, based on the coordinate information of the last non-zero coefficient, prefix information of the horizontal coordinate of the last non-zero coefficient, prefix information of the vertical coordinate of the last non-zero coefficient, suffix information of the horizontal coordinate of the last non-zero coefficient, and suffix information of the vertical coordinate of the last non-zero coefficient of the current block; The encoding unit 1202 is further configured to write the prefix information of the horizontal coordinate of the last non-zero coefficient, the prefix information of the vertical coordinate of the last non-zero coefficient, the suffix information of the horizontal coordinate of the last non-zero coefficient, and the suffix information of the vertical coordinate of the last non-zero coefficient into the codestream.
[0401] In some embodiments, the first determining unit 1201 is further configured to, if the third syntax element identification information indicates that the current sequence uses range extension, determine a last coefficient enable identification information of the current block; The encoding unit 1202 is further configured to, if the last coefficient enable identification information indicates that the current block uses the last coefficient position, encode all coefficients before the last coefficient position according to a predetermined scanning order, and write bit information obtained by encoding and the last coefficient enable identification information into the codestream.
[0402] In some embodiments, the first determining unit 1201 is further configured to determine the value of the last coefficient enable identification information as a first value if the current block uses the last coefficient position, or to determine the value of the last coefficient enable identification information as a second value if the current block does not use the last coefficient position.
[0403] In some embodiments, the last coefficient position is the bottom right corner position of a matrix consisting of all potentially non-zero coefficients in the current block, or the last coefficient position is the last position in the current block where a scan of all potentially non-zero coefficients is performed according to a predetermined scan order.
[0404] In some embodiments, the first determining unit 1201 is further configured to set the position of the last non-zero coefficient to the last coefficient position.
[0405] In some embodiments, the first determination unit 1201 is further configured to determine the width and height of the transformation block that the current block will obtain after a predetermined operation, perform coordinate calculation based on the width and height of the transformation block, obtain the bottom right corner coordinate information of the transformation block, and determine the last coefficient position based on the bottom right corner coordinate information of the transformation block.
[0406] In some embodiments, the predetermined operation includes at least a zero-out operation.
[0407] In some embodiments, when the position of the last non-zero coefficient is set to the last coefficient position, the first determination unit 1201 is further configured to determine the position of the last non-zero coefficient based on the bottom right corner coordinate information of the transform block.
[0408] In some embodiments, the first determining unit 1201 is further configured: when the last coefficient enable identification information indicates that the current block does not use the last coefficient position, to determine prefix information of the horizontal coordinate of the last non-zero coefficient, prefix information of the vertical coordinate of the last non-zero coefficient, suffix information of the horizontal coordinate of the last non-zero coefficient, and suffix information of the vertical coordinate of the last non-zero coefficient of the current block; and to determine the position of the last non-zero coefficient based on the prefix information of the horizontal coordinate of the last non-zero coefficient, prefix information of the vertical coordinate of the last non-zero coefficient, suffix information of the horizontal coordinate of the last non-zero coefficient, and suffix information of the vertical coordinate of the last non-zero coefficient; The encoding unit 1202 is further configured to encode all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, and write the prefix information of the horizontal coordinate of the last non-zero coefficient, the prefix information of the vertical coordinate of the last non-zero coefficient, the suffix information of the horizontal coordinate of the last non-zero coefficient, and the suffix information of the vertical coordinate of the last non-zero coefficient into the codestream.
[0409] In some embodiments, the first determining unit 1201 is further configured to, when the third syntax element identification information indicates that the current sequence uses range extension, determine a sub-block default coding identification information of a sub-block to be coded in the current block; The encoding unit 1202 is further configured to, if the sub-block default encoding identification information indicates that the sub-block to be encoded is to be encoded by default, encode all coefficients in the sub-block to be encoded, and write bit information obtained by encoding and the sub-block default encoding identification information into the codestream.
[0410] In some embodiments, the first determining unit 1201 is further configured to: determine sub-block coding identification information of the sub-block to be coded when the sub-block default coding identification information indicates that the sub-block to be coded is not coded by default; The encoding unit 1202 is further configured to write the sub-block coding identification information into the codestream.
[0411] In some embodiments, the first determination unit 1201 is further configured to determine the value of the sub-block default coding identification information as a first value if the sub-block to be coded is coded by default, or to determine the value of the sub-block default coding identification information as a second value if the sub-block to be coded is not coded by default.
[0412] In some embodiments, the first determining unit 1201 is further configured to determine the value of the sub-block coding identification information as a first value if coding is required within the sub-block, or to determine the value of the sub-block coding identification information as a second value if all coefficients in the sub-block are zero.
[0413] In some embodiments, the first value is one and the second value is zero.
[0414] It is understandable that in this embodiment, a "unit" may be a part of a circuit, a part of a processor, a part of a program, software, or the like, and may of course be modular or non-modular. Also, each component in this embodiment may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated unit may be realized in the form of hardware or in the form of a software functional module.
[0415] If the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essential part of the technical solution of this embodiment, i.e., the part contributing to the prior art, or all or part of the solution of the technology, can be embodied in the form of a software product, and the computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0416] Therefore, an embodiment of the present application provides a computer storage medium applied to the encoding device 120, the computer storage medium storing a computer program, which, when executed by a first processor, realizes the method according to any one of the above-mentioned embodiments.
[0417] Based on the configuration of the encoding device 120 and the computer storage medium, reference is made to FIG. 13, which is a schematic diagram illustrating a specific hardware configuration of the encoding device 120 according to an embodiment of the present application. As shown in FIG. 13, the encoding device 120 may include a first communication interface 1301, a first memory 1302, and a first processor 1303, and each component is coupled via a first bus system 1304. It can be understood that the first bus system 1304 is used to realize the connection communication between these components. In addition to a data bus, the first bus system 1304 includes a power bus, a control bus, and a status signal bus. However, for clarity of explanation, all various buses are denoted as the first bus system 1304 in FIG. 13. Here, The first communication interface 1301 is configured to send and receive signals in the process of sending and receiving information to and from other external network elements.
[0418] The first memory 1302 is configured to store a computer program executable by the first processor 1303 .
[0419] When executing the computer program, the first processor 1303: determining component identification information for the current slice and determining the location of the last non-zero coefficient of the current block corresponding to the component of the current slice; determining coordinate information of the last non-zero coefficient of the current block based on the component identification information and the location of the last non-zero coefficient; encoding all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, and writing bit information, component identification information, and coordinate information of the last non-zero coefficient obtained by the encoding into a codestream.
[0420] It is understood that first memory 1302 in the present embodiment may be volatile or nonvolatile memory, or may include both volatile and nonvolatile memory. Here, nonvolatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM) used as an external cache. By way of illustrative, but non-limiting example, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM), direct memory bus random access memory (DRRAM), etc. The first memory 1302 in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0421] The first processor 1303 may be an integrated circuit chip with signal processing functions. In the implementation process, each step of the method can be completed by an instruction in the form of a hardware integrated logic circuit or software in the first processor 1303. The first processor 1303 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc. Each method, step, and logic block disclosed in the embodiments of the present application can be realized or executed. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in the decoding processor. The software module can be stored in a conventional storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is stored in the first memory 1302, and the first processor 1303 reads the information in the first memory 1302 and completes the steps of the above method in combination with its hardware.
[0422] It is understandable that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing unit may be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof. For a software implementation, the technical solutions described herein may be realized by executing the functional modules (processes, functions, etc.) described herein. The software code may be stored in a memory and executed by a processor. The memory may be implemented in the processor or external to the processor.
[0423] Optionally, as another embodiment, the first processor 1303 is further configured to, when executing said computer program, perform the method according to any of the previous embodiments.
[0424] An embodiment of the present application provides a coding device, which may include a first determination unit and a coding unit. In this way, in a video codec scenario with a high bit width, a high bit rate, high quality, or lossless compression, a reasonable derivation method for the last non-zero coefficient is established according to the law of non-zero coefficient distribution, thereby reducing the coding overhead in the codestream and improving compression efficiency. Furthermore, since the law of non-zero coefficient distribution for each image component is different, the derivation method for the last non-zero coefficient for each image component can be more precisely controlled, i.e., whether each image component uses the last non-zero coefficient position inversion technique can be individually controlled, thereby further improving compression efficiency.
[0425] In yet another embodiment of the present application, based on the same inventive concept as the above-mentioned embodiment, refer to Figure 14, which is a schematic diagram showing the configuration of a decoding device according to the embodiment of the present application. As shown in Figure 14, the decoding device 140 can include an analyzing unit 1401 and a second determining unit 1402, where: The parsing unit 1401 is configured to parse the codestream, determine component identification information of a current slice, and determine coordinate information of a last non-zero coefficient of a current block corresponding to the component of the current slice; The second determining unit 1402 is configured to calculate coordinate information of the last non-zero coefficient to obtain the position of the last non-zero coefficient of the current block when the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion; The analysis unit 1401 further decodes all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, It is configured to determine the coefficients of the current block.
[0426] In some embodiments, the parsing unit 1401 is further configured to parse the codestream and determine first syntax element identification information; The second determining unit 1402 is further configured to perform a step of parsing the codestream and determining component identification information of a current slice if the first syntax element identification information indicates that the current sequence allows the use of last non-zero coefficient position inversion, and the current sequence includes the current slice.
[0427] In some embodiments, the parsing unit 1401 is further configured to perform the steps of parsing the codestream and determining a second syntax element identification information, parsing the codestream and determining a third syntax element identification information if the second syntax element identification information indicates that the current sequence uses the standard extended version, and parsing the codestream and determining a first syntax element identification information if the third syntax element identification information indicates that the current sequence uses a range extension.
[0428] In some embodiments, the second determining unit 1402 is further configured to determine that the second syntax element identification information indicates that the current sequence uses the standard extended version if the value of the second syntax element identification information is a first value, or to determine that the second syntax element identification information indicates that the current sequence does not use the standard extended version if the value of the second syntax element identification information is a second value.
[0429] In some embodiments, the second determination unit 1402 is further configured to determine that the third syntax element identification information indicates that the current sequence uses range extension if the value of the third syntax element identification information is a first value, or to determine that the third syntax element identification information indicates that the current sequence does not use range extension if the value of the third syntax element identification information is a second value.
[0430] In some embodiments, the current sequence using range extension includes the current sequence satisfying at least one of high bit width, high quality, high bit rate, high frame rate, and lossless compression.
[0431] In some embodiments, the second determining unit 1402 is further configured to determine that, if the value of the first syntax element identification information is a first value, the first syntax element identification information indicates that the current sequence allows the use of last non-zero coefficient position inversion, or, if the value of the first syntax element identification information is a second value, determine that the first syntax element identification information indicates that the current sequence does not allow the use of last non-zero coefficient position inversion.
[0432] In some embodiments, the second determining unit 1402 is further configured to determine that, if the value of the component identification information is a first value, the component identification information indicates that the component of the current slice uses last non-zero coefficient position reversal, or, if the value of the component identification information is a second value, the component identification information indicates that the component of the current slice does not use last non-zero coefficient position reversal.
[0433] In some embodiments, the second determining unit 1402 is further configured to: when the component identification information indicates that the component of the current slice does not use last non-zero coefficient position inversion, directly determine the position of the last non-zero coefficient of the current block based on the coordinate information of the last non-zero coefficient; The analysis unit 1401 is further configured to decode all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order to determine the coefficients of the current block.
[0434] In some embodiments, the components include at least one of a first image component, a second image component, and a third image component; the first image component is a luminance component, the second image component is a first chrominance component, and the third image component is a second chrominance component; or The first image component is a red component, the second image component is a green component, and the third image component is a blue component.
[0435] In some embodiments, the second determination unit 1402 is further configured to: determine that, when the components include a first image component, a second image component, and a third image component, if the first image component, the second image component, and the third image component of the current slice all share one component identification information, the number of component identification information of the current slice is one; or determine that the number of component identification information of the current slice is two if two of the first image component, the second image component, and the third image component of the current slice share one component identification information; or determine that the number of component identification information of the current slice is three if the first image component, the second image component, and the third image component of the current slice each use one component identification information.
[0436] In some embodiments, the parsing unit 1401 is further configured to parse the codestream to determine a first component identity of the current slice; Correspondingly, the second determination unit 1402 is further configured to determine that when the value of the first component identification information is a first value, the first image component, the second image component, and the third image component of the current slice all use last non-zero coefficient position inversion.
[0437] In some embodiments, the parsing unit 1401 is further configured to parse the codestream to determine a second component identity and a third component identity of the current slice; Correspondingly, the second determination unit 1402 is further configured to determine that when the value of the second component identification information is a first value, two image components among the first image component, the second image component, and the third image component of the current slice use last non-zero coefficient position inversion, and when the value of the third component identification information is a first value, determine that the remaining image components excluding the two image components of the current slice use last non-zero coefficient position inversion.
[0438] In some embodiments, the parsing unit 1401 is further configured to parse the codestream to determine a fourth component identification, a fifth component identification, and a sixth component identification of the current slice; Correspondingly, the second determining unit 1402 is further configured to determine that if the value of the fourth component identification information is a first value, the first image component of the current slice uses the last non-zero coefficient position inversion; if the value of the fifth component identification information is a first value, the second image component of the current slice uses the last non-zero coefficient position inversion; and if the value of the sixth component identification information is a first value, the third image component of the current slice uses the last non-zero coefficient position inversion.
[0439] In some embodiments, the parsing unit 1401 is further configured to parse the codestream to obtain prefix information of a horizontal coordinate of a last non-zero coefficient, prefix information of a vertical coordinate of a last non-zero coefficient, suffix information of a horizontal coordinate of a last non-zero coefficient, and suffix information of a vertical coordinate of a last non-zero coefficient of the current block; The second determination unit 1402 is further configured to determine the horizontal coordinate of the last non-zero coefficient based on the prefix information of the horizontal coordinate of the last non-zero coefficient and the suffix information of the horizontal coordinate of the last non-zero coefficient, determine the vertical coordinate of the last non-zero coefficient based on the prefix information of the vertical coordinate of the last non-zero coefficient and the suffix information of the vertical coordinate of the last non-zero coefficient, and determine the coordinate information of the last non-zero coefficient of the current block based on the horizontal coordinate of the last non-zero coefficient and the vertical coordinate of the last non-zero coefficient.
[0440] In some embodiments, the second determining unit 1402 is further configured to determine, when the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion, the coordinate information of the last non-zero coefficient of the current block is the horizontal distance and vertical distance between the position of the last non-zero coefficient and the lower right corner position of the current block; Correspondingly, the second determining unit 1402 is further configured to determine the width and height of the current block, perform a subtraction calculation based on the width of the current block and the horizontal distance between the position of the last non-zero coefficient and the lower right corner position of the current block to obtain the horizontal coordinate of the last non-zero coefficient, and perform a subtraction calculation based on the height of the current block and the vertical distance between the position of the last non-zero coefficient and the lower right corner position of the current block to obtain the vertical coordinate of the last non-zero coefficient, and determine the position of the last non-zero coefficient of the current block based on the horizontal coordinate of the last non-zero coefficient and the vertical coordinate of the last non-zero coefficient.
[0441] In some embodiments, the second determining unit 1402 is further configured to: determine that, if the component identification information indicates that the component of the current slice does not use last non-zero coefficient position inversion, the coordinate information of the last non-zero coefficient of the current block is the horizontal distance and vertical distance between the position of the last non-zero coefficient and the upper-left corner position of the current block; and determine the position of the last non-zero coefficient of the current block based on the horizontal distance and vertical distance between the position of the last non-zero coefficient and the upper-left corner position of the current block.
[0442] In some embodiments, the parsing unit 1401 is further configured to parse the codestream and determine a last coefficient enable identification for the current block if the third syntax element identification indicates that the current sequence uses range extension, and to decode all coefficients before the last coefficient position according to a predetermined scanning order to determine the coefficients of the current block if the last coefficient enable identification indicates that the current block uses the last coefficient position.
[0443] In some embodiments, the second determination unit 1402 is further configured to determine that if the value of the last coefficient enable identification information is a first value, the last coefficient enable identification information indicates that the current block uses the last coefficient position, or if the value of the last coefficient enable identification information is a second value, the last coefficient enable identification information indicates that the current block does not use the last coefficient position.
[0444] In some embodiments, the parsing unit 1401 is further configured to, when the value of the last coefficient enable identification information is a second value, parse the codestream to obtain last non-zero coefficient horizontal coordinate prefix information, last non-zero coefficient vertical coordinate prefix information, last non-zero coefficient horizontal coordinate suffix information, and last non-zero coefficient vertical coordinate suffix information of the current block; The second determining unit 1402 is further configured to determine a position of a last non-zero coefficient according to the prefix information of the horizontal coordinate of the last non-zero coefficient, the prefix information of the vertical coordinate of the last non-zero coefficient, the suffix information of the horizontal coordinate of the last non-zero coefficient, and the suffix information of the vertical coordinate of the last non-zero coefficient; The analysis unit 1401 further decodes all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, It is configured to determine the coefficients of the current block.
[0445] In some embodiments, the last coefficient position is the bottom right corner position of a matrix consisting of all potentially non-zero coefficients in the current block, or the last coefficient position is the last position in the current block where a scan of all potentially non-zero coefficients is performed according to a predetermined scan order.
[0446] In some embodiments, the second determining unit 1402 is further configured to set the position of the last non-zero coefficient to the last coefficient position.
[0447] In some embodiments, the second determination unit 1402 is further configured to determine the width and height of the transform block that the current block will obtain after a predetermined operation, perform coordinate calculation based on the width and height of the transform block to obtain the bottom right corner coordinate information of the transform block, and determine the last coefficient position based on the bottom right corner coordinate information of the transform block.
[0448] In some embodiments, the predetermined operation includes at least a zero-out operation.
[0449] In some embodiments, the second determination unit 1402 is further configured to determine the position of the last non-zero coefficient based on the bottom right corner coordinate information of the transform block when setting the position of the last non-zero coefficient to the last coefficient position.
[0450] In some embodiments, the parsing unit 1401 is further configured to parse the codestream and determine a sub-block default encoding identification information of the current block if the third syntax element identification information indicates that the current sequence uses range extension, and to decode all coefficients in the sub-block to be decoded if the sub-block default encoding identification information indicates that the sub-block to be decoded in the current block is coded by default.
[0451] In some embodiments, the parsing unit 1401 is further configured to: parse the codestream, if the sub-block default coding identification information indicates that the sub-block to be decoded in the current block is not coded by default, determine a sub-block coding identification information of the sub-block to be decoded, and decode all coefficients in the sub-block to be decoded if the value of the sub-block coding identification information is a first value.
[0452] In some embodiments, the second determination unit 1402 is further configured to determine that, if the value of the sub-block default encoding identification information is a first value, the sub-block default encoding identification information indicates that the sub-block to be decoded in the current block is encoded by default, or, if the value of the sub-block default encoding identification information is a second value, the sub-block default encoding identification information indicates that the sub-block to be decoded in the current block is not encoded by default.
[0453] In some embodiments, the second determining unit 1402 is further configured to determine to decode all coefficients in the sub-block to be decoded if the value of the sub-block coding identification information is a first value, or to determine that all coefficients in the sub-block to be decoded are zero if the value of the sub-block coding identification information is a second value.
[0454] In some embodiments, the first value is one and the second value is zero.
[0455] As can be understood, in this embodiment, a "unit" may be a part of a circuit, a part of a processor, a part of a program, software, or the like, and may of course be modular or non-modular. Furthermore, each component in this embodiment may be integrated into one processing unit, each unit may exist physically separate, or two or more units may be integrated into one unit. The integrated unit may be realized in the form of hardware or in the form of a software functional module.
[0456] When the integrated unit is realized in the form of a software functional module and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer storage medium applied to the decoding device 140, in which a computer program is stored, and when the computer program is executed by the second processor, the method according to any one of the above-mentioned embodiments is realized.
[0457] Based on the configuration of the decoding device 140 and the computer storage medium, reference is made to FIG. 15, which is a schematic diagram illustrating a specific hardware configuration of the decoding device 140 according to an embodiment of the present application. As shown in FIG. 15, the decoding device 140 may include a second communication interface 1501, a second memory 1502, and a second processor 1503, and each component is coupled via a second bus system 1504. It can be understood that the second bus system 1504 is used to realize the connection communication between these components. In addition to a data bus, the second bus system 1504 includes a power bus, a control bus, and a status signal bus. However, for clarity of explanation, all various buses are denoted as the second bus system 1504 in FIG. 15. Here, The second communication interface 1501 is configured to send and receive signals in the process of sending and receiving information to and from other external network elements.
[0458] The second memory 1502 is configured to store a computer program executable by the second processor 1503 .
[0459] When the second processor 1503 executes the computer program, Parsing the codestream to determine component identification information of a current slice, and determining coordinate information of a last non-zero coefficient of a current block corresponding to the component of the current slice; If the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion, calculating coordinate information of the last non-zero coefficient to obtain the position of the last non-zero coefficient of the current block; and determining the coefficients of the current block by decoding all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order.
[0460] Optionally, as another embodiment, the second processor 1503 is further configured to, when executing said computer program, perform the method according to any of the previous embodiments.
[0461] It is understood that the second memory 1502 has the same hardware function as the first memory 1302, and the second processor 1503 has the same hardware function as the first processor 1303, and they will not be described again here.
[0462] An embodiment of the present application provides a decoding device, the decoding device comprising: an analyzing unit; and a second determining unit. In this way, in a video codec scenario with a high bit width, a high bit rate, high quality, or lossless compression, a reasonable derivation method for the last non-zero coefficient can be established according to the law of non-zero coefficient distribution, thereby reducing the coding overhead in the codestream and improving compression efficiency. Furthermore, since the law of non-zero coefficient distribution for each image component is different, the derivation method for the last non-zero coefficient for each image component can be more precisely controlled, i.e., whether each image component uses the last non-zero coefficient position inversion technique can be individually controlled, thereby further improving compression efficiency.
[0463] It should be noted that, in this application, the terms "comprise," "include," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus comprising a set of elements includes not only those elements but also other elements not expressly listed or inherent elements of such process, method, article, or apparatus. Unless otherwise limited, an element defined with the phrase "comprises..." does not exclude the presence of other identical elements in a process, method, article, or apparatus that includes the element.
[0464] The numbers of the above-mentioned embodiments of the present application are merely for the purpose of explanation and do not represent the superiority or inferiority of the embodiments.
[0465] The methods disclosed in the several method embodiments provided herein can be combined in any manner without conflict to obtain new method embodiments.
[0466] The features disclosed in the several product embodiments provided herein may be combined in any non-conflicting manner to obtain new product embodiments.
[0467] Features disclosed in any method or apparatus embodiment provided herein may be combined in any non-conflicting manner to obtain new method or apparatus embodiments.
[0468] The above content is merely a specific embodiment of the present application, and the protection scope of the present application is not limited thereto. Any modifications or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims. [Industrial Applicability]
[0469] In an embodiment of the present application, the encoding device determines the component identification information of the current slice, determines the position of the last non-zero coefficient of the current block corresponding to the component of the current slice, determines the coordinate information of the last non-zero coefficient of the current block based on the component identification information and the position of the last non-zero coefficient, encodes all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, and writes the bit information, component identification information, and coordinate information of the last non-zero coefficient obtained by encoding into a codestream. The decoding device analyzes the codestream, determines the component identification information of the current slice, determines the coordinate information of the last non-zero coefficient of the current block corresponding to the component of the current slice, and if the component identification information indicates that the component of the current slice uses last non-zero coefficient position inversion, calculates the coordinate information of the last non-zero coefficient to obtain the position of the last non-zero coefficient of the current block, and decodes all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order to determine the coefficients of the current block. In this way, in a video codec scenario with a high bit width, a high bit rate, high quality, or lossless compression, by establishing a reasonable derivation method for the last non-zero coefficient according to the law of non-zero coefficient distribution, it is possible to reduce the coding overhead in the code stream and improve the compression efficiency.In addition, since the law of non-zero coefficient distribution of each image component is different, it is also possible to use the component identification information to control whether to use the last non-zero coefficient position reversal technique for each image component, thereby further improving the compression efficiency.
Claims
1. A decoding method applied to a decoding device, comprising: Analyzing the codestream to determine last non-zero coefficient position inversion identification information and determine coordinate information of the last non-zero coefficient of the current block; Calculating coordinate information of the last non-zero coefficient to obtain the position of the last non-zero coefficient of the current block, If the last non-zero coefficient position inversion identification information indicates that the last non-zero coefficient position inversion is used, determining that the coordinate information of the last non-zero coefficient of the current block is a relative horizontal distance and a vertical distance between a position of the last non-zero coefficient and a position of a bottom right sample of the current block; If the last non-zero coefficient position inversion identification information indicates that last non-zero coefficient position inversion is not used, determining that coordinate information of the last non-zero coefficient of the current block is the relative horizontal and vertical distances between the position of the last non-zero coefficient and the position of an upper left sample of the current block, and determining the position of the last non-zero coefficient of the current block based on the relative horizontal and vertical distances between the position of the last non-zero coefficient and the position of an upper left sample of the current block; and decoding all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order to determine the coefficients of the current block.
2. The decoding method comprises: Parsing the codestream to determine a first syntax element identification; If the first syntax element identification information indicates that the current sequence allows the use of a last non-zero coefficient position reversal, performing a step of parsing the codestream and determining a last non-zero coefficient position reversal identification information, wherein the current sequence includes a current slice. The decoding method of claim 1 .
3. The decoding method comprises: Parsing the codestream to determine second syntax element identification information; If the second syntax element identification information indicates that the current sequence uses a standard extended version, parsing the codestream to determine a third syntax element identification information; If the third syntax element identification information indicates that the current sequence uses range extension, performing the step of parsing the codestream and determining a first syntax element identification information. The decoding method according to claim 2 .
4. The current sequence using range extension includes the current sequence satisfying at least one of a high bit width, a high quality, a high bit rate, a high frame rate, and lossless compression. The decoding method according to claim 3.
5. the components include at least one of a first image component, a second image component, and a third image component; the first image component is a luminance component, the second image component is a first chrominance component, and the third image component is a second chrominance component; or the first image component is a red component, the second image component is a green component, and the third image component is a blue component; Parsing the codestream to determine last non-zero coefficient position reversal identification information includes parsing the codestream to determine a first last non-zero coefficient position reversal identification information; Correspondingly, the decoding method is and determining, when a value of the first last non-zero coefficient position reversal identification information is a first value, that the first image component, the second image component, and the third image component all use last non-zero coefficient position reversal. The decoding method of claim 1 .
6. If the third syntax element identification information indicates that the current sequence uses range extension, the decoding method comprises: analyzing the codestream to determine a last coefficient enable identification of the current block; If the last coefficient enable identification information indicates that the current block uses a last coefficient position, decoding all coefficients before the last coefficient position according to a predetermined scanning order to determine the coefficients of the current block; The decoding method comprises: determining a width and height of a transformed block obtained by performing a predetermined operation on the current block, the predetermined operation including at least a zero-out operation; Performing coordinate calculation based on the width and height of the transformation block to obtain coordinate information of the bottom right sample of the transformation block; determining the last coefficient position based on coordinate information of a bottom right sample of the transform block; 5. The decoding method according to claim 3 or 4.
7. An encoding method applied to an encoding device, comprising: determining a last non-zero coefficient position inversion identification information to determine the position of the last non-zero coefficient of the current block; determining coordinate information of the last non-zero coefficient of the current block based on the last non-zero coefficient position inversion identification information and the position of the last non-zero coefficient; encoding all coefficients before the position of the last non-zero coefficient according to a predetermined scanning order, and writing bit information obtained by encoding, the last non-zero coefficient position reversal identification information, and the coordinate information of the last non-zero coefficient into a codestream; the position of the last non-zero coefficient includes an initial horizontal coordinate and an initial vertical coordinate of the last non-zero coefficient, the initial horizontal coordinate and the initial vertical coordinate being a relative horizontal distance and a relative vertical distance between the position of the last non-zero coefficient and a position of an upper-left sample of the current block; Correspondingly, determining coordinate information of the last non-zero coefficient of the current block based on the last non-zero coefficient position inversion identification information and the position of the last non-zero coefficient includes: When the value of the last non-zero coefficient position inversion identification information is a first value, determining coordinate information of the last non-zero coefficient by performing calculation based on an initial horizontal coordinate and an initial vertical coordinate of the last non-zero coefficient; The encoding method comprises: If the value of the last non-zero coefficient position inversion identification information is the first value, determining that the coordinate information of the last non-zero coefficient is a relative horizontal distance and vertical distance between the position of the last non-zero coefficient and the position of a bottom right sample of the current block; and determining, when the value of the last non-zero coefficient position inversion identification information is a second value, that the coordinate information of the last non-zero coefficient is the relative horizontal and vertical distances between the position of the last non-zero coefficient and the position of an upper-left sample of the current block.
8. Before determining the last non-zero coefficient position reversal identification information, the encoding method includes: determining a first syntax element identification; performing a step of determining the last non-zero coefficient position reversal identification information if the first syntax element identification information indicates that the current sequence allows the use of last non-zero coefficient position reversal, wherein the current sequence includes a current slice. The encoding method according to claim 7.
9. Before determining the first syntax element identification information, the encoding method comprises: determining a second syntax element identification; determining a third syntax element identification if the second syntax element identification indicates that the current sequence uses a standard extended version; performing the step of determining the first syntax element identification information if the third syntax element identification information indicates that the current sequence uses range extension. The encoding method according to claim 8.
10. The current sequence using range extension includes the current sequence satisfying at least one of a high bit width, a high quality, a high bit rate, a high frame rate, and lossless compression. The encoding method according to claim 9.
11. the components include at least one of a first image component, a second image component, and a third image component; the first image component is a luminance component, the second image component is a first chrominance component, and the third image component is a second chrominance component; or the first image component is a red component, the second image component is a green component, and the third image component is a blue component; determining the last non-zero coefficient position reversal identification information includes determining a first last non-zero coefficient position reversal identification information; Correspondingly, the encoding method is and determining a value of the first last non-zero coefficient position reversal identification information as a first value when the first image component, the second image component, and the third image component all use last non-zero coefficient position reversal. The encoding method according to claim 7.
12. If the third syntax element identification information indicates that the current sequence uses range extension, the encoding method comprises: determining a last coefficient enable identification of the current block; If the last coefficient enable identification information indicates that the current block uses the last coefficient position, encoding all coefficients before the last coefficient position according to a predetermined scanning order, and writing bit information obtained by encoding and the last coefficient enable identification information into a codestream; The encoding method comprises: determining a width and height of a transformed block obtained by performing a predetermined operation on the current block, the predetermined operation including at least a zero-out operation; Performing coordinate calculation based on the width and height of the transformation block to obtain coordinate information of the bottom right sample of the transformation block; determining the last coefficient position based on coordinate information of a bottom right sample of the transform block; 11. The encoding method according to claim 9 or 10.
13. An encoding device comprising: a first memory; and a first processor; the first memory is configured to store a computer program executable by the first processor; Encoding device, wherein the first processor is configured to perform the method of any one of claims 7 to 12 when executing the computer program.
14. a decoding device comprising: a second memory; and a second processor; the second memory is configured to store a computer program executable by the second processor; A decoding device, wherein the second processor is configured to perform the method of any one of claims 1 to 6 when executing the computer program.
15. 10. A computer readable storage medium storing a computer program / instructions and a bitstream, the computer program / instructions causing a processor to perform the decoding method of claims 1 to 6 to decode the bitstream to generate a video or image.
16. 13. A computer readable storage medium storing a computer program / instructions and a bitstream, the computer program / instructions causing a processor to perform the encoding method of claims 7 to 12 to generate a bitstream.